Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2014-01-10
6
Medium Priority
?
805 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 1000 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 29

Accepted Solution

by:
pepr earned 1000 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses

886 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