Solved

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

Posted on 2014-01-10
6
675 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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
expectj telnet failing 5 45
Java exception bubble up 2 21
Python -- Read from csv for sending mail 9 44
Setup GlassFish 4 21
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
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 …
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

856 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