Solved

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

Posted on 2014-01-10
6
629 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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 28

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
When we want to run, execute or repeat a statement multiple times, a loop is necessary. This article covers the two types of loops in Python: the while loop and the for loop.
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

758 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now