Solved

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

Posted on 2014-01-10
6
722 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

A set of related code is known to be a Module, it helps us to organize our code logically which is much easier for us to understand and use it. Module is an object with arbitrarily named attributes which can be used in binding and referencing. …
Strings in Python are the set of characters that, once defined, cannot be changed by any other method like replace. Even if we use the replace method it still does not modify the original string that we use, but just copies the string and then modif…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…

729 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