Improve company productivity with a Business Account.Sign Up

x

Game Programming

Game programming is the software development of video games. Game programming requires substantial skill in software engineering as well as specialization in simulation, computer graphics, artificial intelligence, physics, audio programming, and input. Like other software, game development programs are generated from source code to the actual program by a compiler. Source code can be developed with almost any text editor, but most professional game programmers use a full integrated development environment (IDE).

Share tech news, updates, or what's on your mind.

Sign up to Post

Hi
I am bewildered by some of my Python bugs today, with a new approach of my Python chess engine.

The ChessBoard class doesn't connect with my ChessPiece data members.ChessBoard.pyChessPiece.pyChessGame.pyChessPlayer.py

The board tries to instantiate ChessPiece objects that are a white pawn, like ChessPiece.PIECE_PAWN
PIECE_PAWN is a totally valid data member in the ChessPiece class,
but the error states it is a non-existent attribute - PIECE_COLOR... too

Maybe I'm being poisoned by my Java old habits, eg there are no public static equivalents

How does my code look, also, style wise? My code must be stylistically proper! What have I missed, attached?
Does my ABC player look okay?

Thanks
0
Free Tool: Subnet Calculator
LVL 12
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Hi
I had to bitterly accept an expert comment recently, J/K

..Implying that my usage of CamelCasing in my code was lame, and I should use underscores.
My personal feeling was that camelCasing was easier to read, less long, but this article below confirms the expert opinion, underscores are better!

here

So I grudgingly_accept!  j/k

Thanks
0
Hi
I'm whipping up this quick chessBoard data structure in Python, but I think my C/Java habits are tripping me somehow.
The objects aren't linking up correctly,and are giving a roll of errors : I have a chessGame class to contain the chessBoard.
I'll do the chessPiece class once this works.
It should be simple

Here is the big chessGame class: That now, just creates the chessboard, and has the main code
import chessBoard

class chessGame:
    def __init__(self):
        print("\n\n.........")
        c=chessBoard()


print('chess main')

chessGame()

Open in new window


Here is the chessBoard:
class chessBoard:

    def __init__(self):

        self.pieces=[]

        #white pawns
        for i in range(0,9):
            print(i)

Open in new window


There are missing lines, but once this simple structure works, I'll be set

Where am I going wrong?

Thanks
0
Hi
None of my iDrive backups have completed without an error, and I cant see a simple reason. - MacBook

I am doing the 'backup when press the button' not scheduled, because I don't want the OS clogged while I'm coding my globe changing projects :)

Does anything in this log printout help identify my problems? What about the skipped, missing files?

The summary says this:

Start time: 04/07/2018 06:27:03 AM
End time: 04/07/2018 06:29:32 AM

Files considered for backup: 574517
Files already present in your account: 572558
Files backed up now: 429  Size: 19.15 MB
Files failed to backup: 1530

Backup operation failed.

Open in new window



Some of the files/folders selected for backup may have been excluded from the operation. To view excluded files / folders, go to the "Exclude Files / Folders from backup" section of Settings tab in IDrive application.

In settings, there is an 'exclude files' panel.
I don't want to exclude anything! I want my entire McBook saved!
What am I missing?

Thanks
0
Hi
For my Python RTS / MOBA server,

I am at a decision where I should either make a class for reading UDP activity updates from the clients over TCP activity ( a failsafe)
Should I have a UDPlistener class and a TCPlistener class?
or should I have a packetListener class with a UDPlisten method and  also, a TCPlisten method? - that are each made into Threads?
I think an all-in-one approach would make linking into the game smoother?

both would work, but which would look best? Is Python better suited to one?

Thanks
0
Hi
When my dad saw this claim, attached JPG, seemingly from my website trademark managers, he said he thought it looked like a scam.
I thought it was plausibly, possibly legit, but bec I'm not doing the website anymore, I was disinclined to care. Im not paying another $2,000 into this thing.
Did some Nigerians find my domain info and send me this bill? I already paid all the bills they said I'd need to pay. I was concerned about being fined.

Is this sheet some kind of phishing scam? It looks like a standard commercial building in Manhattan.  (244 Madison Realty Corporation (glotrade)

I don't remember the glotrade name. I'm a hawk on scam scents now after being taken before. I'm not paying it. I'll send Luca Brasi, or Joe Pesci up there to explain it to for me.
Thanks
0
Hi
I am not certain if League of Legends is an RTS type network server, or an FPS? The player movements are well spaced out, so I'd think RTS

In Summoner's rift, is it only 5 people/champions playing? Is that the practical limit on players, in most network games?

If I port my working Java RTS server that I finished a little while ago to Python, could I expect any performance shift? It is TCP messaging, with UDP duplicates sent afterwards for speed.

Thanks
0
Hi
In all my Java games, I have used code like :
public static int STAR_TYPE_RED_DWARF=1
public static int STAR_TYPE_WHITE_DWARF=2
public static int STAR_TYPE_BLUE_GIANT=3
public static int STAR_TYPE_SUPER_GIANT=4
and many more game object constants

What is the best way to replicate this in python, so these constants are automatically associated with its object when writing code?
I haven't seen anything like this yet

Thanks
0
Hi
My Python RTS server reboot from my finished Java one needs some clarifications.

The example networking code at this Python page doesn't work, when it clearly should, code below

here

The line with bind() is where it raises exceptions and it's baffling me! - cut and paste!
My code that won't compile is...
import socket, sys


if __name__ == "__main__":

    print('__main__')
    port_num=1234

    try:


        # Create a TCP/IP socket
        sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

        # Bind the socket to the port
        server_address = ('localhost', port_num)
        print ('starting up on %s port %s', server_address)
        sock.bind(server_address)

    except:
        print('Error')
        exit()

Open in new window


Did I miss a step in pyCharm settings?

Thanks
0
Hello Everyone
0
Free Tool: Port Scanner
LVL 12
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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.

I am trying to create a 2D board game.  To move a game piece, you click on the game piece to select it, then move the mouse to the square you want the piece to move to.

I am wanting to draw a "path" as the mouse moves to the potential destination square, showing which squares the piece will move to, taking into account any obstacles the game piece will need to navigate around.

The part I am struggling with most is how to draw the path line.  For example, the line will look different based upon the game piece moving SOUTH (indicated in blue) vs moving EAST (indicated in red).

[NOTE:  I am not sure what this is called in gaming circles (the shape of the lines themselves).  Is it called aliasing?  Anti-aliasing is supposed to "smooth"-out the "jagged" stair-step look of the lines formed (lines drawn at an angle, or circles).  I know that the letters I am typing, when zoomed up to like 800% of normal size appear very jagged. ]

I am just wondering what the algorithm is called and where I might go for help on this (including here on EE, of course).


Example:
draw-line.png
0
Hi
All the best modern games are pseudo 3D, like League of legends and Starcraft 2.

Is it pseudo 3d? - It is 2D images used smartly at correct locations?

How do Starcraft 2 and League of Legends achieve their 3D feel?

Would Python be able to do decent game-play FPS & updates in time with my client networking class?
MIT and everyone is teaching CS100 in Python, and I've seen some promising 2D demos.
Thanks
0
Hi
Considering the RTS project many of you helped me complete,

Java had no problem being an abstract base class client engine,
and the JFrame was smooth.
Will a Python GUI do adequately with a client engine abc ? The abstract method can update a GUI's objects. Will I need to do double buffering on a GUI?
Could I make a Python effort approach  League of Legends quality? I'm keeping the server in Java, but the client abc will be ported to Python.
Thanks
0
Hi

I've been playing League of Legends with no problems,
and all of a sudden it gets into this 'Attempting to reconnect' mode at the re-spawn altar after my champion gets served
and the game is essentially locked and I cant move my primary dude. I can move the camera, but not my champion.

Is that something I did wrong in my game-play?

Thanks
0
Hi I am trying to get my games to output the current time in seconds that the game is running for as a score for the player in the canvas but I keep getting an undefined var instead of the number?

Does anyone have any idea whats wrong with my code??


Thanks, See code below.

HTML5 Canvas
JS
var Game = {
    canvas : undefined,
    ctx : undefined,
    backgroundImage : undefined,
    backgroundMusic :undefined,
    soundImage: undefined,
    soundImagePosition : { x : 750, y : 10 },
    vy : 0,
    rocket : undefined,
    rocketPosition : { x : 350, y : 400 },
    dxSpeed: 7,
	dySpeed: 3,
	keyboard : { keyDown : -1 },
	keys : {
    A: 65,     B: 66,      C: 67,      D: 68,       E: 69,      F: 70,
    G: 71,     H: 72,      I: 73,      J: 74,       K: 75,      L: 76,
    M: 77,     N: 78,      O: 79,      P: 80,       Q: 81,      R: 82,
    S: 83,     T: 84,      U: 85,      V: 86,       W: 87,      X: 88,
    Y: 89,     Z: 90, 	   LA:37,      UA:38, 	    RA:39,      DA:40,
 }
};

function handleKeyDown(evt) {
    Game.keyboard.keyDown = evt.keyCode;
}

function handleKeyUp(evt) {
    Game.keyboard.keyDown = -1;
}

Game.start = function () {
    
    document.onkeydown = handleKeyDown;
    document.onkeyup = handleKeyUp;

    Game.canvas = document.getElementById("myCanvas");
    Game.ctx = Game.canvas.getContext("2d");
  

    Game.backgroundMusic = new Audio();
    Game.backgroundMusic.src = "assets/audio/start.mp3";
    

Open in new window

0
Hi

If I put my keyboard listening in pygame in my drawing/game loop, it obviously won't be checked constantly.
I must obviously have a Thread listening for keyboard input, mouse movement to play my game and update internal game variables.


Is this just a new class I must make with two methods each to listen to pygame keyboard/mouse activity. Case closed?


Thanks
0
Hi

If Python can be run in a browser,

Will my RTS client's game window be playable? - how? - browser window? - in its own window?
It looks like printf's are written to the browser window, but will Threading occur normally?
I'll keep my invulnerable RTS server in Java. And do a client in pure Python now. Will it be as good as in Java?
Thanks
0
Hi

Someone has pics for me on photo bucket.
Do I have to pay? it seems so.

Is this a legit site? I am sick of scams

Thanks
0
Hi
Python array/list instantiation, import and other declarations are confusing me!

In my code attached, I have a main class for holding the data structures for a platform game level, basically x,y, positions and length of the platform, for now,
I don't understand why the 'module' object is not callable - error? It seems it should be trivial. What does that mean? I intend to end up with a list of terrain objects
In platform.py, must I do 'import platform as platform' is that telling me how to call methods, get data from that class?

Thanks
platform.py
mainclass.py
0
Free Tool: Path Explorer
LVL 12
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Hi,

I finally got Python images to be plopped on the screen, just blitting, a lonely mutalisk, but not flapping.
To make my mutalisk flap its wings in python, or any of my many animated GIF's, for that matter, must I blit them frame by frame? I was surprised it wasn't automatic flapping, like in other situations.

Here is the blit code that finally worked. . .
here

Thanks
0
Hi

If I'd like to make a platform game like Contra,

Are there any acceptably decent animated GIF's somewhere out there for me to choose from?
or some adequate transparent ones for me to do alpha coding with? Something close to a predator, an alien, Arnold, terminator, Robocop, scorpion, rancor! tauntaun, ewok gungan

What do most coders use for these place-holders?

Thanks
0
Hi

I finished our colossal collaboration of a network game with a central server, a while ago. I will convert it to python now that I'm shifting to it as well. Is that unadvisable - python might not be optimal for a game server?

I know that MIT had an RTS AI coding contest, before.
There's also ORTS, open rts
There seem to be many similar links on Google.
The MIT contest was geared to a confusing, un-watchable mess of a game, in my opinion.

Do these types of contests have any traction? now? Any of them non-college?
I have many ideas, some non 3D war.
Thanks
0
Hi

I have had my cards hacked enough times to get really annoyed.
I receive balance sheets with card purchases in Rhode Island, or California, and I live in NC !

I paid with Paypal today, which means, my card was never exposed to direct hackers, I think.
Is that correct? VISA always refunds these fraudulent charges ( >$5,000, total, one time, over a few months)
Do hackers steal my paypal login?
Must I always do (card) online payments with paypal? I'm sick of cancelling cards for safety's sake
Thanks
0
Hi

I have my pygame ready and I'm going to start being a coding-personal-trainer teacher for nearby kids.
No doubt, there are many books for me to gain wisdom on how to proceed? Or, is there a good web-site done?
I asked some previous questions in this sphere, but some additional references/syllabus would be useful.
Thanks
0
the requirements for the game is :

a single player playing against the computer.
The computer automatically generates its fleet locations
The single player enters via keyboard the location of her or his fleet.
Fleet components:
Battleship: 5 spaces (1 battleship)
Crusier: 4 spaces (1 cruiser)
Submarine: 3 spaces (1 submarine)
Destroyer: 2 spaces (1 destroyer)
Trawlers/spy ships: 1 space each (5 trawlers)
The board size: 10 spaces x 10 spaces
The human player starts by guessing a location. If a miss, the computer tells the user it was a miss. If a hit, the computer tells the user it was a hit. If a hit sinks a ship, that ship type is identified. The user's shot display is updated with the location of the hit and/or miss.
Both the user's screen and the user's guess screens are displayed for the user and updated during game play.
The game continues, alternating "shots" on the opposing fleet.
The game is over when either the user's or the computer's fleet is totally sunk.
User interface requirements:
two fleet screen matrixes
User's fleet positions
user's shot record (and hit/miss pattern)
a running count of number of shots, number of hits, and number of misses.
May be either text-based or GUI
Program requirements:
All course standards met, to include internal documentation
All variables validated and no out of range errors experienced during gameplay
method calls, parameter passing and returns to main(), properly prototyped and called.
computer …
0

Game Programming

Game programming is the software development of video games. Game programming requires substantial skill in software engineering as well as specialization in simulation, computer graphics, artificial intelligence, physics, audio programming, and input. Like other software, game development programs are generated from source code to the actual program by a compiler. Source code can be developed with almost any text editor, but most professional game programmers use a full integrated development environment (IDE).

Top Experts In
Game Programming
<
Monthly
>