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,

When i ran below JAXB example

package marshalCollection;
 
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
 
@XmlRootElement(name = "bike")
public class Bike {
 
	String color;
	int engineCapacity;
	int vin;
 
	public Bike() {
 
	}
 
	public Bike(int vin, int engineCapacity, String color) {
		this.vin = vin;
		this.engineCapacity = engineCapacity;
		this.color = color;
	}
 
	public String getColor() {
		return color;
	}
 
	@XmlElement
	public void setColor(String color) {
		this.color = color;
	}
 
	public int getEngineCapacity() {
		return engineCapacity;
	}
 
	@XmlElement
	public void setEngineCapacity(int engineCapacity) {
		this.engineCapacity = engineCapacity;
	}
 
	public int getVin() {
		return vin;
	}
 
	@XmlAttribute
	public void setVin(int vin) {
		this.vin = vin;
	}
 
	public String toString() {
		return "Bike [color=" + color + ", engineCapacity=" + engineCapacity
				+ ", vin=" + vin + "]";
	}
 
}

Open in new window


package marshalCollection;
import java.io.File;
import java.util.ArrayList;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
 
public class JAXBTest {
 
	public static void main(String[] args) {
 
		Bike hondaCBR = new Bike(25631248, 250, "black");
		Bike pulsar = new Bike(45896253, 200, "red");
		Bike karizma = new Bike(56982351, 225, "yellow");
 
		ArrayList<Bike> bikes = new ArrayList<Bike>();
		bikes.add(hondaCBR);
		bikes.add(pulsar);
		bikes.add(karizma);
 
		ShowRoom showRoom = new ShowRoom();
		showRoom.setId("someId");
		showRoom.setName("Bikes Showroom");
		showRoom.setBikes(bikes);
 
		File showRoomDump = new File("./showRoom.xml");
 
		try {
			JAXBContext context = JAXBContext.newInstance(ShowRoom.class);
			Marshaller jaxbMarshaller = context.createMarshaller();
 
			jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
 
			jaxbMarshaller.marshal(showRoom, showRoomDump);
 
			Unmarshaller jaxbUnmarshaller = context.createUnmarshaller();
			ShowRoom unmarshalledShowRoom = (ShowRoom) jaxbUnmarshaller
					.unmarshal(showRoomDump);
			System.out.println(unmarshalledShowRoom);
 
		} catch (JAXBException e) {
			e.printStackTrace();
		}
 
	}
 
}

Open in new window


package marshalCollection;
 
import java.util.ArrayList;
 
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
 
@XmlRootElement
@XmlType(propOrder = { "name", "id", "bikes" })
public class ShowRoom {
 
	private ArrayList<Bike> bikes = new ArrayList<Bike>();
	private String name;
	private String id;
 
	@XmlElementWrapper(name = "bikeList")
	@XmlElement(name = "bike")
	public ArrayList<Bike> getBikes() {
		return bikes;
	}
 
	public void setBikes(ArrayList<Bike> bikes) {
		this.bikes = bikes;
	}
 
	@XmlElement
	public String getName() {
		return name;
	}
 
	public void setName(String name) {
		this.name = name;
	}
 
	@XmlAttribute
	public String getId() {
		return id;
	}
 
	public void setId(String id) {
		this.id = id;
	}
 
	public String toString() {
		return "ShowRoom [bikes=" + bikes + ", name=" + name + ", id=" + id
				+ "]";
	}
 
}

Open in new window


i got below output xml

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<showRoom id="someId">
    <name>Bikes Showroom</name>
    <bikeList>
        <bike vin="25631248">
            <color>black</color>
            <engineCapacity>250</engineCapacity>
        </bike>
        <bike vin="45896253">
            <color>red</color>
            <engineCapacity>200</engineCapacity>
        </bike>
        <bike vin="56982351">
            <color>yellow</color>
            <engineCapacity>225</engineCapacity>
        </bike>
    </bikeList>
</showRoom>


also output in console as
ShowRoom [bikes=[Bike [color=black, engineCapacity=250, vin=25631248], Bike [color=red, engineCapacity=200, vin=45896253], Bike [color=yellow, engineCapacity=225, vin=56982351]], name=Bikes Showroom, id=someId]

why we need below
@XmlRootElement
@XmlType(propOrder = { "name", "id", "bikes" })

@XmlElementWrapper(name = "bikeList")
      @XmlElement(name = "bike")


@XmlAttribute etc both in Bike.java as well as ShowRoom.java classes. Can we just have in one place. Can we use instead on XSD to do this.

Please advise
0
Hi

My Java chess behemoth AI is going well, but I'd like to graduate from a textual chess-board-state to some sort of chess JFrame or Frame that isn't lame.
RNBQKBNR is good for initial white, with black lower case, but now that things are picking up, it's time for graphics.
I suppose I need 2D GIF's of every piece type on both white and black for it all? What components should I use on a JFrame, or just simply paste an 8x8 grid of Image bitmaps on a Graphics G context?

Is there a good zip or anything available? I couldn't see one. Google or Github linking.


Thanks
0
I have written a simple fbx importer using the c++ FBX SDK. I am attempting now to insert it into an Unreal engine  game project.

As a standalone application, it works fine, but when I add it to the Unreal c++ project, I get unresolved externals. This, i believe, is due to the lib not being linked.

For the standalone app, I followed this guide:

http://help.autodesk.com/view/FBX/2015/ENU/?guid=__files_GUID_6E7B1A2E_584C_49C6_999E_CD8367841B7C_htm

For some reason the unreal project settings are less than a usual visual studio project, so I can't seem to add the library linking that the fbx sdk requires. (see image)

How can i add the library to this project?
Or, if I create my importer as a DLL function, can I call it from this project without linking the lib? Or will I strike the same issue?

Sorry if this is confusing, please ask any questions and I will clear it up.


visual studio missing properties?
0
Hi
For a chess whip up I'm doing,
I'm using a char 8x8 to store the board state. White uppercase, black lower.
I'm noticing that passing various board objects around gets moves recurring on each other, pointer madness.
If I pass .clones of the board object into methods, will it be a true copy of the character[][] grid, - new [][] and primitives created?

board.clone()

?
Thanks
0
I have a project where I need to display some gaming stats on a monitor. It needs to be a fully rendered screen, that takes up 100% of the height and width. In the old days (Windows 9x), you changed the screen mode. What is the current best practice to do this? Also, this was purposely posted in Java and Visual Basic .NET because I am trying to choose which platform we're going to use to do this.
0
Does anyone know if there a name for the subject of flat-pack box design, and what is/are the corresponding mathematical methods applied for modelling the assembly from 2D (flat) to 3D (assembled)? Presumably these are used in box design processes.

Background: I'm trying to design a certain type of box, and slowly coming to the conclusion that I may need a more analytical approach.

Thanks for your input!
0
Hi
For my selection panel in my Java RTS,
I need, for each unit, a single frame from its animated Image Object, rather than an animated unit in the selection panel.
Can I extract a new Image that is one of those frames?

Thanks
0
Hi

I have need for editing an animated GIF for an RTS project on my Mac, but my one Windows computer died.
I'd like to download this photoshop for Mac but I am not sure if it is really free, and works?
Is it a scam download?

here

Thanks
0
I wish more PC games were designed to go back and play certain levels or create a map or arena mode like Unreal Tournament.  For instance, Shadow of Mordor allows you to go back time and time again to enjoy just running around in the world and enjoy battling orcs.  Skyrim is like that.  The Batman games are like that, etc.  However, on a game like Wolfenstein the New Order, it would be great if they created maps that you could have a blast with.  There are no mods for you to be able to do this either.  So my question is if I back up my Wolfenstein with Game Save Manager (to be safe), can I go back and just re-play the levels I want without messing up the fact that I already finished the game?  If I do go back and re-play several levels and it does screw up my existing saves, I should be able to restore with GSM and all will be back to where it was before, right?

Or if Mass Effect 3 has a replay level capability, then I could do the same with this game as well, could I not?
0
Hi,

Can anybody tell me how to make these animated GIF's a transparent background? - for a game.
an elephant, a cyborg and a yeti !
I have a MacBook 10.9yeti GIF
elephant
cyborg
 
Thanks
0
Hi

I'm getting ready to demo my game, and I'd prefer it to have top shelf graphics.
The godzilla I have is motionless and just  silhouette. Place holder, - Is there a good site w animated monster GIF's, with transparent background? from an RTS like perspective
Google didn't get me quite what I wanted.

Thanks

Beavoid
0
Hi
This rotating unfinished death-star is weirdly way off pic in the transparent background void on the right.
I am going to demo some Java code and I'd like some decent game components.

My brother has the photoshop in the family, and instead of bothering him, it would take a good hand at photoshop a few seconds to isolate the Death-Star component of the animated gif and make a new GIF of only the animated death-star, perfectly centered in a new GIF square exactly the size of the DeathStar.

Much appreciated.
Thanks

-BeavoidUnfinished animated rotating Death-Star GIF
0
I've been working on a sound engine using XAudio2.

On my development computer everything works.
    (AMD FX08350, with a Sound Blaster X-Fi Xtreme Audio card, running Windows 7 64-bit and using DirectX 11.  Code::Blocks, TDM MinGW, and DirectX SDK installed.)

When I move the program to a different computer (Intel core i5-3470, on-board sound card, running Windows 7 64-bit and using DirectX 11) I get an HRESULT of 0xFB06A210 from XAudio2Create (which redirects to CoCreateInstance).

Looking at HRESULT, this has an S,R,C,N,and r of 1, a Facility of 0x0306, and a code of A210.  I can't find any information on what this means or how to get XAudio2 to work on the test computer?

Can anyone help me?
0
i'm creating an app that visualize 3d interior. i have create the interior model in 3ds max.
in 3ds max the lightmap looks great but when it exported to unity. unity has it own lighting
and i cant get quality close to 3ds max for lighting. the light that baked in 3dsmax is overided by unity.

i want to create something like in picture 460 and 460.
image 1 is viewed on 3ds max and image 2 is on unity. i want the interior quality can close to 3ds max.

here are some reference app

https://play.google.com/store/apps/details?id=com.Sagadio.CinereResortApartment
https://play.google.com/store/apps/details?id=com.Sagadio.CpvJambi
https://play.google.com/store/apps/details?id=com.Sagadio.CpvCirebon

i wan  to create someting like this
image2.png
image1.jpg
IMG-0462.PNG
IMG-0460.PNG
0
Hi
I suspect it, but thought I'd ask to be sure. It may be pretty obvious.

I am getting unexpected explosions on my Java RTS server since I am completing adding UDP packet sending alongside TCP. I suspect I must have a listen datagram socket and a write datagram socket, and not use the same one for both read and write? Have 2 separate UDP sockets for each need?
So, if the server uses both TCP and UDP to send game updates to the client, and listen, each client must also receive TCP and UDP for reliability? But, are there complications? The server sends state updates in UDP over TCP. and the same for the client sending player activity to the server. Two UDP sockets? on clients and server? A TCP listener class and  UDP listener class?
Must each client engine have datagram outs and ins, and TCP outs and ins? 2 TCP,  out and in, 2 UDP, an out and an in?

I use delegates to send and receive. Must each client delegate class on the server have UDP and TCP outs and ins?
Doesn't this much overlap cause conflicts, even on different ports?
Thanks


I should let the kernel choose the ports for new udpsockets?
0
I remember playing a Kings' Quest game around 20 years ago where I encountered a mirror and then I said "Mirror, mirror on the wall who's the fairest of them all?"

After doing that I encountered Snow White.

I can't remember exactly which King's Quest game that was from.

Can anyone tell me which King's Quest game that was from?
0
I have AGK downloaded from this site:

http://www.appgamekit.com/free-trial.php
I got the free trial version to work with VS2010, but having trouble to work with Visual Studio 2013. If you experts think it's possible, please show me an example. An VS2013/AGK template is appreciated.

Or  Is it possible to use Version 2 (AGK2) to work with VS2013?  I would order it AGK2 work with Visual Studio 2013.
http://www.appgamekit.com/order.php

Thanks
0
Hi
I'm considering all the ways for my Java RTS server to encode the game-state in a byte array for each client's valid vision.
 Obviously, thousands of units are possible, also, if ordinance is included as a unit.
I have 2 byte integers and a band of tuples for each unit's x,y location and a boolean for whether or not the unit exists.
The whole issue is how many units to make room for, even with supply limits for units.
In an 8 FFA or a 4 v 4 game, thousands of units will exist.
How big could my byte[] be? 4096 ? 32k 64k
- for optimal transfer? what should my data structure look like?
Thanks
0
Hi
In My RTS, I'm finally doing some decent graphics work after the in-Game engine is proceeding nicely.
This attached unfinished Death Star animated GIF works. (using it as a test image)
The original one (small) unfds.gif turns perfectly as a Java Image object, in its 30 frames. and resets to the beginning once the frames cycle to completion.
but, if I double the size in Mac Preview app, unfDSbigger.gif, it still has 30 frames and is ready to work, but as a Java Image object, it stops the gif frame flipping at the end and doesn't recycle to the beginning and is stuck (bored) The small GIF works fine, but the same code with the bigger file doesn't.

Maybe the preview app doesn't correctly resize animated GIF's? It is twice as big, but only turns once, and doesn't restart, to continue turning,  smoothly.

The GIF's are attached
Thanks
unfDS.gif
unfDSbigger.gif
0
Hi
I'd like to get this unfinished death star animated gif centered, but I don't have the tools.
It is a transparent animated gif.
I'd like it to be perfectly centered within the square frame.
Can anybody help me make
centeredufds.gif
?
Attached

Thanks
unfDS.gif
0
Hi,

My Python chess data structure code makes an 8x8 array,
but my print method can't access the Board global data structure, and it must be something simple that I can't see. . .
What have I one wrong?
What is wrong in the print method start-up at the bottom?

Thanks

__author__ = 'jameshancock'

class DeepRedChess :



    def __init__(self):

        Board = [[0 for x in range(8)] for x in range(8)]

        # [0 to 7][0 to 7] makes 64 square board[0 to 7 numbers][a-h, 0 to 7]

        # white pieces are lower case, knights are n, cause k is king
        Board[0][0]='r'
        Board[0][1]='n'
        Board[0][2]='b'
        Board[0][3]='q'
        Board[0][4]='k'
        Board[0][5]='b'
        Board[0][6]='n'
        Board[0][7]='r'
        # black pieces are upper case
        Board[7][0]='R'
        Board[7][1]='N'
        Board[7][2]='B'
        Board[7][3]='Q'
        Board[7][4]='K'
        Board[7][5]='B'
        Board[7][6]='N'
        Board[7][7]='R'

    def printBoard(self):

        for x in range(0,7):
            print Board[0][x]


drc = DeepRedChess();
drc.printBoard();

Open in new window

0
Hi


In Java, I did a quickie byte[][] 8x8 (code below) to store my chess board with each piece having  a number to determine its type.
What is the best way in Python to do something like this? If I do AI heuristics with recursion, how do I delete objects, boards that have been used? How do I make new objects to be created doing recursion?
What should some of this look like? What might moving a random pawn look like? No heuristics, just a random pawn move and then doing recursion on the new board state? I can perfect the legality code, capturing,  once I might see a few random pawns moving forward 1 or 2 squares into an empty square.
I printed the board in text like . .
rnbqkbnr
........
........
........
........
........
RNBKQBNR

Here is the Java game setup code:
static byte[][] newGame() {
		byte[][] n = new byte[8][8];
		
		//pawn, black pieces right side, locations are [row][column]
		for (int i=0; i<8;i++) n[6][i]=7;
		//pawn, white piece left side, locations are [row][column]
		for (int i=0; i<8;i++) n[1][i]=6;

		//pieces white, black,  0 = empty square		
		
		
		n[0][0]=1; //white rook
		n[0][1]=2; //white knight
		n[0][2]=3; //white bishop
		n[0][3]=4; //white queen
		n[0][4]=5; //white king
		n[0][5]=3; //white bishop
		n[0][6]=2; //white knight
		n[0][7]=1; //white rook
		
		n[7][0]=7+1; //black rook
		n[7][1]=7+2; //black knight
		n[7][2]=7+1; //black bishop
		n[7][3]=7+2; //black queen
		n[7][4]=7+1; //black king
		n[7][5]=7+2; //black 

Open in new window

0
Hi
For my RTS..
I am storing the units that my player-client selects on the client and adding which units are selected to the action encoding message to the server.
However, I can make it optimal, so that each time a unit is selected or deselected, the server is informed, so knows what is selected by each client, so ctrl-clicking groupings is simple and units associated with an activity is simple too if the server knows what units have been selected.
It is always either a grouping or a selection that is moved. If hundreds of units are selected, possible, the byte[] would be huge.
Is this what pro RTS's do?

Thanks
0
Hi There!

I'm currently studying my masters in business information systems but at the moment I have a keen interest in motion technology like the Xbox Kinect. If I want to study this type of technology where would I start and what course would I have to do? what programming language would I have to learn?

I also noticed you can get Kinect for PC and was wondering if I could just learn some sort of programming as a hobby to be able to harness Kinect technology or would I have to go do a full blown engineering course for it?

Any advice would be greatly appreciated.

TY,
J
0
Hi,

The entire game was programmed in Unity3d with UnityScript(JS), however one C# script was included (GameCenter integration).

At the moment Game Center Script (C#) is attached to the First Scene Object (not destroyable object, not sure if it needs to be not destroyable, please advise).

In another scene, where GameOver is happening, when GameOver is triggered, the attached UnityScript(JS) has to be able to change Variable in the C# script (from false to true).

(Once the Variable in C# changes to true, score is being submitted to Game Center with the help of C# script.)

Changing variables from one UnityScript in another is not a problem, but how to change variable in C# from the UnityScript?

In Unityscript it would be something like that:
GameCenterJS.gameOver = true;

But it doesn't work as
GameCenterCS.gameOver = true;

What is the proper way to do it?

Thank you for your advice
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
>