Solved

Is Python super-awesome for top quality RTS? . . . pygame Q's

Posted on 2014-01-10
6
688 Views
Last Modified: 2014-03-05
Hi

I made a pretty decent RTS in Java a while ago.

DatagramSocket's, swing

but, I am doing a class at UNCW, and they have moved from Java as their marquee language to Python.

I am so far cool with this, I like what I've seen.

So, is Python completely capable of making a pro quality RTS, sounds, network, as good as Starcraft 2, maybe not the 3D landscape? What does Pygame have in it for RTS? How good is their JFrame?
Will I have to do the networking myself?
Has someone laid the road map already?

Thanks
0
Comment
Question by:beavoid
  • 3
  • 2
6 Comments
 
LVL 27

Assisted Solution

by:d-glitch
d-glitch earned 250 total points
ID: 39773337
Python is best for productivity (getting a program done) and prototyping.  It is not best for performance.  Here are some benchmarks:
       http://benchmarksgame.alioth.debian.org/u64q/python.php

But the performance may still be adequate for your application.
0
 
LVL 27

Expert Comment

by:d-glitch
ID: 39773351
0
 

Author Comment

by:beavoid
ID: 39773490
I have peeked at class definitions and inheritance.

I didn't see, however, a way in Python for java style interface classes, that force a client to flesh out certain methods.
I'd like a core engine type client class that guarantees clients fill out an interface?

Thanks
0
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 
LVL 29

Accepted Solution

by:
pepr earned 250 total points
ID: 39773771
I didn't see, however, a way in Python for java style interface classes, that force a client to flesh out certain methods.
I'd like a core engine type client class that guarantees clients fill out an interface?

Python as the language is not extremely suitable for that kind of guarantees. It is flexible, the objects can modify itself in runtime, and also the non-syntactic problems are revealed only in runtime. This way, your expectations may not be fully satisfied. Anyway, there is the NotImplementedError exception class that was designed for your purpose. Try the following:
#!python3

class AbstractBase:
    def __init__(self):
        '''Abstract base class that cannot be instantiated directly.'''
        raise NotImplementedError('Cannot be instantiated directly.')

    def print_hello(self):
        print('Hello!')

    def client_method(self):
        raise NotImplementedError('must be implemented in the derived class')


class DerivedIncomplete(AbstractBase):
    def __init__(self):
        print('Just instantiated.')


class DerivedComplete(AbstractBase):
    def __init__(self):
        print('Instantiated.')

    def client_method(self):
        print('client_method(() called.')


# The following command would fail.
# a = AbstractBase()

# Here the instantiation is OK, also the print_hello(). However,
# call to the client_method() fails in runtime.
di = DerivedIncomplete()
di.print_hello()
# di.client_method()

# In the following, everything is OK.
dc = DerivedComplete()
dc.print_hello()
dc.client_method()

Open in new window

0
 

Author Comment

by:beavoid
ID: 39774329
Should I run the server on a separate machine?
Previous questions have insisted that the Java game state be handled on a server machine, as there can be no cheating.
I was pleased with this idea. I had it working on the client before, and the server only relayed the players' moves, and the game-state on the clients was updated appropriately.
But, does Python suffer from Java's calamitous / hackable security and visibility issues?
Can I maintain the game-state on each client without it being spied on within Python?

Thanks
0
 

Author Comment

by:beavoid
ID: 39807836
Thanks.

A few quick side questions before close?

1

Why does Python do this thing when they have (self) in brackets? - in method coding
It's confusing, because nothing is being passed in there. What is it specifying?
How are methods done that take primitives and Objects?

2

In spots where I need to specify the file location of an image file, like ball.jpg

on this page here

How do I make it an image URL, like this mutalisk here
Where would it find ball.jpg, btw?
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Java string replace 11 64
Notify sent to other threads in Java 9 44
learn programming 8 74
Ruby or Python 7 66
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

697 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question