Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 08 Aug 2001
Offline Last Active Yesterday, 10:44 PM

#5188763 What Is Your Game Design Technique?

Posted by Glass_Knife on Yesterday, 10:44 AM

What Is Your Game Design Technique?


I will start by saying there is no correct technique.  That will change with every team and every project.  I can only offer a suggestion.


I think you've got these first two steps backwards.  You will come up with a great idea, spend all this time on documentation, and then finally create a prototype, only to find out that while it sounds good on paper, it isn't fun.  Now you've done a lot of work which you won't want to throw away, and you may end up trying really hard to make the game fun but fall short.


If it was me, I would pair up a designer and an artist, and have them create some prototypes.  If you're not a programmer, just do it on paper.  Exchange the games, play them, and see what you guys like.  Once you've got a fun core idea, then you do all the documentation stuff.


I am speaking from experience here, having made many games that just aren't as fun as they were in my head.

#5188744 String Split With Different Milti-Character Delimiters

Posted by Glass_Knife on Yesterday, 08:15 AM

Use the XML parser like dmatter and Ashaman73 said.  The reason you use a standard like XML is to take advantage of the libraries and tools available.

#5187712 Getting Started

Posted by Glass_Knife on 17 October 2014 - 02:23 PM

I would suggest you focus on making games, and let the rest take care of itself.  


If you are already using C, give SFML a try.  You can start with their examples and build from there.




Personally, I enjoy learning how things work and doing everything from scratch.  If that's not your idea of fun, there's nothing wrong with using one of the popular engines.


Unity is one, and LibGDX is another one.


As far as wasting your time, you are most definitely NOT!  Anything you learn in one language can be applied to others, and an experienced programmer can pick up a new language in a couple of weeks.  That's just syntax.  The hard part is learning how to start with an idea, and finish it, fixing all the problems encountered along the way.  

#5187652 When you realize how dumb a bug is...

Posted by Glass_Knife on 17 October 2014 - 09:14 AM

It is amazing to me how easy it is to get off on the wrong track and take so much time before you realize your mistake.  But you didt the right thing: always assume it's your code.  Except it wasn't.  Damn.


I just went through this.  Weird bug that could never happen.  There is it, right on QA's screen.  They were using an older version before the bug fix.  Never even crossed my mind.

#5187651 How to remove GET variables from URL in php

Posted by Glass_Knife on 17 October 2014 - 09:09 AM

If you want to hide the URL parameters, then you have to use POST.  If you can't, and are worried about someone seeing the data in the GET, then use HTTPS.


It would be easier to offer advice if you were more specific.  

#5186934 How to Separate the Rendering Code from the Game Code

Posted by Glass_Knife on 14 October 2014 - 09:29 AM

I would suggest this book 



Game Engine Architecture, Second Edition Hardcover – August 15, 2014


by Jason Gregory  (Author)


Before I read this book (the first edition) I would have suggested doing it as show above.  But after, I would do things differently.  


First, you can use composition to create game objects.  If it is drawn, add a Renderable component.  If it moves, add a Movable component.  If it hits stuff, add a collision component.


You can read more about it here:



The reason you don't want game objects to draw themselves is because you loose the ability to speed things up.  


In the above example, each object do this:

Bind textures
Bind mesh

If all object draw themselves, you have no way to sort and batch the rendering code.  For example, if you have a Render object that contains all the Renderable objects, you could do this:

bind texture (once)
bing mesh (once)
for each renderable that uses these

Context switches tend to take a lot of time.  If you have objects draw themselves you limit your options when things slow down.  For a small game it won't matter.  But when things get larger you may need some extra speed.

#5186364 Game Engine and Games

Posted by Glass_Knife on 11 October 2014 - 08:42 AM

It sounds like you've done your research.  That means that you have a desire to learn, and the motivation to try.  So try it.


It is best to start by making a 2D game such as Tetris, Pong, Asteroids, or something easy along those lines.  Pick something with easy graphics, simple game play, and nothing new.  For this prototype, don't worry if the game is fun, just make a game.  See what it takes.  By the time you finish you'll be on your way.


I do suggest you learn something about programming too.



Good luck!

#5186269 Keyboard input: poll, push or pull?

Posted by Glass_Knife on 10 October 2014 - 05:07 PM

I concur with SmkViper.


^^^ Yes.  


The first one, where each object polls the input makes it hard to add keyboard/joystick mapping.  Imagine you need an analog stick or the arrow keys to both do the same thing in the game.  You don't want game objects worrying about that.


The last one, pushing, seems like a good idea at first, but it doesn't work either.  Again, you can't smooth out data, you have no way to fire events when two or more keys are down, or use two buttons as a combo, or anything like that.  Imagine a fighting game.  If the input was pushed on another thread you would never make sense of it.  Plus, you may want some way to record player input and play it back at a slow speed.  You can't do replays by simulating input events pushed from the OS.  


Do the massive poll, generate any input events, and either make the events available or have objects request push notifications when an event fires.  You can still have poll, push, and pull that way, but one level away from the input.

#5186261 Swig virtual functions with parameters

Posted by Glass_Knife on 10 October 2014 - 04:16 PM

It's been a while since I messed with this stuff, but I remember you could mark function parameter in the swig.i file as IN, OUT, or INOUT (or something like that, I don't remember the syntax).  If you had a C++ function like void add( double* pValue ) { } then you'd get a Java function that took a double array and converted it to the right stuff.


You see this kind of junk when you use OpenGL in Java.  


glVertex2iv(int[] v, int v_offset)

Entry point to C language function: void glVertex2iv(const GLint * v) 


Here you are using an array instead of a pointer.




I believe this is the stuff I'm talking about.

#5186051 Rendering engine design

Posted by Glass_Knife on 09 October 2014 - 01:51 PM

For code reviews, go here:  http://fabiensanglard.net/


A small but complete open source rendering engine that has easy to read code.  I don't think that can exist.  A production engine will be hard to read.  But if you find one, please post!


I would however, recommend these books:


Physically Based Rendering, Second Edition: From Theory To Implementation 

by Matt Pharr et al. 

Link: http://amzn.com/0123750792


Game Engine Architecture, Second Edition 

by Jason Gregory 

Link: http://amzn.com/1466560010

#5185786 Swig virtual functions with parameters

Posted by Glass_Knife on 08 October 2014 - 10:45 AM

You are the first person I've seen that has done this besides myself.  I was wondering if anyone else ever did this.  


I have not had any experience extending classes.  Every time I ran into something like this I would create something in either the C++ side or the Java side (whichever was easier) that wrapped up the problem or added a level of indirection.  


But I think if you are trying to extend a C++ then there will be overhead.  I always made a complete interface in C++, wrapped it, swig'd it, and then wrapped that code in Java so no one ever had to know it was there (because it can get really weird passing in "pointers").


Do you have the source code for both parts?  Maybe there is another way to approach the problem?

#5185614 Polymorphism and Interfaces in Java

Posted by Glass_Knife on 07 October 2014 - 02:41 PM

It creates an interface object and assign it to an ArrayQueue() object.


You've got this backwards.  The code creates an object of type ArrayQueue and assigns it to a reference of type QueueInterface.  Because ArrayQueue implements the QueueInterface, ArrayQueue "is a" QueueInterface.  It is valid for a QueueInterface to point to an ArrayQueue.


Why use an interface?  Because sometimes there are objects that can all do the same thing but aren't the same type.  For example, consider these classes:

  • ByteStream
  • File
  • Network Socket

All of these objects will let you read() some bytes, so they all have a read() method, but they aren't all the same type of object.  So a base class that all these inherit from that contains a read() method doesn't work.  But the can all implement a Readable Interface

public interface Readable {
  byte[] read(); // just an example

So later you are writing code, and you want to read some data.  You could have a method for each type of class, but you don't need to do that.  What if someone adds another kind of class that can read() data later?  Instead, you use the Readable interface, and any class that lets you read data (of any type) will work.

public class SomeClass {

   public void readData( Readable readable ) { 
      byte[] data = readable.read();

#5184663 LOL - I wrote a poem about OpenGL

Posted by Glass_Knife on 02 October 2014 - 05:27 PM

*scream* why'm I getting a blank screen?


proof you have programmed in OpenGL...

#5184377 Why do i get lag?

Posted by Glass_Knife on 01 October 2014 - 12:16 PM

If you are testing everything on one machine you can fool yourself.  Everything can be internal, not using the wires or the networking hardware, and you can fool yourself.  I've run into this before testing a Java server and client on the same machine, only to find that it was way slower than I thought when finally using all the stuff in between.


If you've setup a local network and you are still having trouble, try wireshark to see if what you think is happening is really happening.  These things are really hard to guess at.

#5184082 Where can i find info about auto hero-job and or auto enemies difficulties im...

Posted by Glass_Knife on 30 September 2014 - 10:40 AM

You tagged the post as Java and Unity, but Unity doesn't use Java so I'm not sure what you are asking for.


Adaptive systems will use neural networks and genetic algorithms to give the appearance of learning, but this is really advanced stuff.  I would suggest you start with a simple example and build it up from there.




Good Luck!