Game Engine Question

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

Post Reply
Viliasas
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 4
Joined: Mon Sep 14, 2009 9:53 am
Favorite Gaming Platforms: NDS, PSP
Programming Language of Choice: C++
Location: Å iauliai
Contact:

Game Engine Question

Post by Viliasas »

Hi,
i just recently got my PSP and seeing that there is alot of interesting homebrew on it, i started learning how to program on PSP. I already tried some simple programs, but what i really would like to make is some sort of game engine. Nothing too fancy... For started i would be really happy if i could make 2D sprites move over a picture (map) and maybe changing the map when sprite walks out of the screen.

Everything would be nice, but i really don't know how game engine should work... I've red about this a bit and come to a conclusion that i should write my code inside a while(1) { } loop. Is this true and what should happen in it, that i could achieve my goal?
User avatar
hurstshifter
ES Beta Backer
ES Beta Backer
Posts: 713
Joined: Mon Jun 08, 2009 8:33 pm
Favorite Gaming Platforms: SNES
Programming Language of Choice: C/++
Location: Boston, MA
Contact:

Re: Game Engine Question

Post by hurstshifter »

Viliasas wrote:Hi,
i just recently got my PSP and seeing that there is alot of interesting homebrew on it, i started learning how to program on PSP. I already tried some simple programs, but what i really would like to make is some sort of game engine. Nothing too fancy... For started i would be really happy if i could make 2D sprites move over a picture (map) and maybe changing the map when sprite walks out of the screen.

Everything would be nice, but i really don't know how game engine should work... I've red about this a bit and come to a conclusion that i should write my code inside a while(1) { } loop. Is this true and what should happen in it, that i could achieve my goal?

Hey Viliasas. Sounds to me like you might be a bit confused on the 'game engine' term. A while(){} loop is generally what your main game loop will utilize, but doesn't necessarily have anything to do with your engine design. It would be useful for us if you could give us some background on what sort of programming experience you have so we know how to answer your question best. From the way you explained your question, I feel that it might not be a good idea for you to jump right into designing a PSP homebrew engine. Start simple with (like you said) displaying sprites and moving them around the screen. Perhaps try some basic animation, projectiles, sound, etc... For a beginner I feel that it is much easier to start with the game itself, then as you are coding you will decide what features need to be in your engine (draw functions, collision functions, physics, particle effects, etc...). Let us know how you are coming along with this.
"Time is an illusion. Lunchtime, doubly so."
http://www.thenerdnight.com
User avatar
MarauderIIC
Respected Programmer
Respected Programmer
Posts: 3406
Joined: Sat Jul 10, 2004 3:05 pm
Location: Maryland, USA

Re: Game Engine Question

Post by MarauderIIC »

hurstshifter wrote:it might not be a good idea for you to jump right into designing a PSP homebrew engine
I gather that this would be because it's not very friendly, but I might be wrong.
I realized the moment I fell into the fissure that the book would not be destroyed as I had planned.
Viliasas
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 4
Joined: Mon Sep 14, 2009 9:53 am
Favorite Gaming Platforms: NDS, PSP
Programming Language of Choice: C++
Location: Å iauliai
Contact:

Re: Game Engine Question

Post by Viliasas »

Hi,
thanks for your reply... Well, when talking about my programing experiece - it's not too good. Basicaly i'm studying IT Engineering at the local university (in Lithuania). There we aren't learning any complex programing, so i just have some basic knowledge in C++, Java, Assembler.

I know that you are right, that game engine is too difficult for me, but i really don't want to make some ping pong, packman or tetris remake. In my opinion i would like something that i could improve over time and i could learn by doing it.

P.S. About "game engine" term - you are right. I just want to make RPG type game. Where something moves on a map, you can talk with it and etc.
User avatar
Falco Girgis
Elysian Shadows Team
Elysian Shadows Team
Posts: 10294
Joined: Thu May 20, 2004 2:04 pm
Current Project: Elysian Shadows
Favorite Gaming Platforms: Dreamcast, SNES, NES
Programming Language of Choice: C/++
Location: Studio Vorbis, AL
Contact:

Re: Game Engine Question

Post by Falco Girgis »

MarauderIIC wrote:
hurstshifter wrote:it might not be a good idea for you to jump right into designing a PSP homebrew engine
I gather that this would be because it's not very friendly, but I might be wrong.
It's really not.

You should totally start with something like SDL. Get your picture to "move" and "change maps" on your PC, before you think about writing code for and debugging on foreign hardware.
Viliasas
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 4
Joined: Mon Sep 14, 2009 9:53 am
Favorite Gaming Platforms: NDS, PSP
Programming Language of Choice: C++
Location: Å iauliai
Contact:

Re: Game Engine Question

Post by Viliasas »

Well, even if i would do it in SDL, i still don't know what should happen in the game... In this topic i didn't asked what programing language to chose and for what to write with it :D So, could anyone tell me what happens in the "game engine". From one example i see that i need to initiate screen, graphics, check if something is pressed and do accordingly to it, then i need output information to screen. Correct me if i'm wrong...
User avatar
M_D_K
Chaos Rift Demigod
Chaos Rift Demigod
Posts: 1087
Joined: Tue Oct 28, 2008 10:33 am
Favorite Gaming Platforms: PC
Programming Language of Choice: C/++
Location: UK

Re: Game Engine Question

Post by M_D_K »

I still can't get psp-gdb to connect to my psp ;/

So I opt for the best debugging practice in the world, Careful thought and code peppered with printf()
Gyro Sheen wrote:you pour their inventory onto my life
IRC wrote: <sparda> The routine had a stack overflow, sorry.
<sparda> Apparently the stack was full of shit.
User avatar
Bludklok
Chaos Rift Junior
Chaos Rift Junior
Posts: 241
Joined: Tue Apr 14, 2009 1:31 am
Current Project: EnigmaCore
Favorite Gaming Platforms: PC, N64, Playstation1, Playstation2
Programming Language of Choice: C++
Location: New Jersey
Contact:

Re: Game Engine Question

Post by Bludklok »

Viliasas wrote:I know that you are right, that game engine is too difficult for me, but i really don't want to make some ping pong, packman or tetris remake. In my opinion i would like something that i could improve over time and i could learn by doing it.
The games that will benefit you most are the little ones like ping pong, packman, or tetris. Fact is, if you try to create some big RPG engine when you really don't have the concept of engines, sufficient C++ language, and aren't too familiar with the SDK your using you're going to get knocked back on your ass. Save yourself the time and frustration and just start out small.
Viliasas wrote:Well, even if i would do it in SDL, i still don't know what should happen in the game... In this topic i didn't asked what programing language to chose and for what to write with it :D So, could anyone tell me what happens in the "game engine". From one example i see that i need to initiate screen, graphics, check if something is pressed and do accordingly to it, then i need output information to screen. Correct me if i'm wrong...
The while() loop of a game engine would go primarily like this:

1) Get input.

Code: Select all

/* Player presses W */
2) Do stuff.

Code: Select all

/* Player->y--*/
3) Draw stuff like images.

Code: Select all

/* Draw all of the content.*/
4) Repeat

Code: Select all

/* End of loop */
I'm not too sure of how many loops are run in a second (which mainly depends on the system hardware if you don't specify a set game speed) but it's run multiple times each second.
Youtube
Website
Current project: Enigma Core
Viliasas
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 4
Joined: Mon Sep 14, 2009 9:53 am
Favorite Gaming Platforms: NDS, PSP
Programming Language of Choice: C++
Location: Å iauliai
Contact:

Re: Game Engine Question

Post by Viliasas »

Thanks :) Going to try to make something out of this... 8-)
Post Reply