* WalrusIRC

You need to have 5 posts and not be part of restricted usergroups in order to use the WalrusIRC embedded shoutbox. However, you can also access our IRC channel called #CodeWalrus via EFnet.

Author Topic: Game engine structure  (Read 1319 times)

0 Members and 1 Guest are viewing this topic.

Offline Snektron

  • Lvl 69 Russian Snake
  • CodeWalrus Staff
  • Super User
  • Topic Management
  • Join Date: Dec 2014
  • Location: Netherlands
  • Posts: 3150
  • Post Rating Ratio: +31/-0
  • SSSssssss.....
    • RobinDeWalvis
    • Kzyrox
    • RobinDeWalvis
    • View Profile
    • quantuminfinity
  • Gender: Male
Game engine structure
« on: March 27, 2015, 05:23:17 pm »
I was starting on some simple program today, and when i wanted to draw something, i noticed OpenGL wouldn't really
draw my lines. Since i used Java with still LWJGL 2.9 i decided to update to LWJGL 3, but this newer version completely changes
things like displays and such, so i decided to make a new engine. Normally i just use the simple engine i made some time ago,
which only handles display creation, openGL initialization, and a game loop. And since i want to write a better engine, i'm wondering
how i would create a good engine. I don't want to create an enourmous thing like Unity or Unreal, but just something i can easily make
OpenGL programs with. Though the engine will mostly be used by me, i still want to write it like a proper library.
What things shall i initialize with the game code?
And what is a good general structure?
Things like object loading i can do myself, i'm more interested in a general game (engine) structure. :)
Also if you make games, how do you make your structure?
(as i said i use java, but this is more a general question)

thanks :)


  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


Offline Duke "Tape" Eiyeron

  • Urist McEiyolobster
  • Super User
  • Join Date: Nov 2014
  • Location: (V)(-_(//));(V)
  • Posts: 1636
  • Post Rating Ratio: +11/-2
  • Fanciest Walrus of the oceans.
    • @@Eiyeron
    • Eiyeron
    • /u/Eiyeron
    • Eiyeron
    • View Profile
    • Rétro-Actif : Rétro/Prog/Blog
  • Gender: Male
Re: Game engine structure
« Reply #1 on: March 27, 2015, 08:53:34 pm »
I second this question, this can be very helpful to see insights from other people to extend the way we think about making games.
  • Calculators owned: A lot.

Offline Scipi

  • Full User
  • Domain Name Owner
  • CW 4x3 challenge - 3rd place
  • *
  • Join Date: Nov 2014
  • Location: Lost Town
  • Posts: 164
  • Post Rating Ratio: +1/-0
  • CodeKitten ^w^
    • s1ay3r44
    • Scipii
    • _Scipi
    • Scipi
    • View Profile
    • ScipiSoftware
  • Gender: Male
Re: Game engine structure
« Reply #2 on: March 28, 2015, 05:34:22 am »
I've always went with a simple MVC setup for my "engine." Or at least my coding structure. I will generally have an input handler that would compare the states of all keys on a given frame and the previous to determine if the key has been pressed, help, released, or is idle. Then I would pass around a struct containing that info in an array to the code that needs it. I would have the core "game" logic split up into a finite state machine. Each state has an input, tick, and draw method. Then for drawing to the screen I would have objects whose entire purpose was to draw a single aspect of my game. For instance, I would have a mapRenderer that takes a map object and the window. It would create and use tileRenderers to draw the individual tiles and so on. I would also keep all my game resources inside a singleton object in global scope for easy access.

This isn't so much advice for an engine, though. More how to structure your games. You can reuse much of it, though and is easy to make so it has no dependencies.
  • Calculators owned: TI-83+, Nspire, Nspire CX, Casio Prizm




Offline DJ Omnimaga

  • Omni founder & CW co-founder
  • CodeWalrus Staff
  • Super User
  • Forum Maintenance
  • Original 5
  • CodeWalrus Supporter
  • *
  • Topic Management
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 17827
  • Post Rating Ratio: +89/-4
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • View Profile
    • DJ Omnimaga music store
  • Gender: Male
Re: Game engine structure
« Reply #3 on: March 28, 2015, 06:06:20 am »
I have much to learn about game engine structure and stuff. Although in the past my engines were not hard to port to new games (eg ROL2 uses a lot of code from ROL1 and Illusiat 6 through 12, with the exception of Illusiat 8, use the same map engine overall), a lot of stuff is still too much hard-coded for my tastes. One day I really want to make an RPG engine where all I have to do to create a new game is replace the data.

I do not have any experience with stuff such as 3D rendering engines like Unity and Unreal, though.
  • Calculators owned: TI-73, TI-80 (broken), TI-81, TI-82, TI-83, TI-83+ (broken), TI-83+ (broken), TI-83+SE (broken), TI-84+, TI-84+CSE, TI-84+CE, TI-85, TI-86, TI-89T, TI-92, TI-Nspire, TI-Nspire CX (semi-broken), HP 39gII, HP Prime, Casio fx-7000G, fx-7400G+, fx-7700GE, fx-9750G+, fx-9750GII, fx-9860G, cfx-9850G, FX-1.0+, fx-CG10, fx-CP400
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nexus 5, Atari 2600, Lynx, SMS, Game Gear, Genesis, Dreamcast, NES, SNES, N64, GCN, Wii, Wii U, GBA, DS, 3DS, PS2, PS3, PS4, PSP, PSVita, XBox 360, XBOne

Bandcamp|Reverbnation|Facebook|Youtube|Twitter
Retired Omnimaga admin (2001-11) and editor (2012-14)
??? ??? ??? ???

Offline Duke "Tape" Eiyeron

  • Urist McEiyolobster
  • Super User
  • Join Date: Nov 2014
  • Location: (V)(-_(//));(V)
  • Posts: 1636
  • Post Rating Ratio: +11/-2
  • Fanciest Walrus of the oceans.
    • @@Eiyeron
    • Eiyeron
    • /u/Eiyeron
    • Eiyeron
    • View Profile
    • Rétro-Actif : Rétro/Prog/Blog
  • Gender: Male
Re: Game engine structure
« Reply #4 on: March 28, 2015, 06:59:20 am »
DJ, that is already what i want to do with HBE : pass a selected part of data and the engine would run totally independently.

Unfortunately, for this kind of engine, when you want to do scripted events, you will probably have to run a scripting language (like FF did).
  • Calculators owned: A lot.

Offline Snektron

  • Lvl 69 Russian Snake
  • CodeWalrus Staff
  • Super User
  • Topic Management
  • Join Date: Dec 2014
  • Location: Netherlands
  • Posts: 3150
  • Post Rating Ratio: +31/-0
  • SSSssssss.....
    • RobinDeWalvis
    • Kzyrox
    • RobinDeWalvis
    • View Profile
    • quantuminfinity
  • Gender: Male
Re: Game engine structure
« Reply #5 on: March 28, 2015, 12:19:42 pm »
@Scipi a general structure is helpful too :)

Unfortunately, for this kind of engine, when you want to do scripted events, you will probably have to run a scripting language (like FF did).
Brainf***?:trollface:
  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


Offline DJ Omnimaga

  • Omni founder & CW co-founder
  • CodeWalrus Staff
  • Super User
  • Forum Maintenance
  • Original 5
  • CodeWalrus Supporter
  • *
  • Topic Management
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 17827
  • Post Rating Ratio: +89/-4
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • View Profile
    • DJ Omnimaga music store
  • Gender: Male
Re: Game engine structure
« Reply #6 on: March 28, 2015, 09:58:19 pm »
DJ, that is already what i want to do with HBE : pass a selected part of data and the engine would run totally independently.

Unfortunately, for this kind of engine, when you want to do scripted events, you will probably have to run a scripting language (like FF did).
Do you mean for NPC convos and events where NPCs move in specific directions and where there is automated movement and teleporting to different rooms? I really need to try making this one day, to make it easier to make new RPGs.
  • Calculators owned: TI-73, TI-80 (broken), TI-81, TI-82, TI-83, TI-83+ (broken), TI-83+ (broken), TI-83+SE (broken), TI-84+, TI-84+CSE, TI-84+CE, TI-85, TI-86, TI-89T, TI-92, TI-Nspire, TI-Nspire CX (semi-broken), HP 39gII, HP Prime, Casio fx-7000G, fx-7400G+, fx-7700GE, fx-9750G+, fx-9750GII, fx-9860G, cfx-9850G, FX-1.0+, fx-CG10, fx-CP400
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nexus 5, Atari 2600, Lynx, SMS, Game Gear, Genesis, Dreamcast, NES, SNES, N64, GCN, Wii, Wii U, GBA, DS, 3DS, PS2, PS3, PS4, PSP, PSVita, XBox 360, XBOne

Bandcamp|Reverbnation|Facebook|Youtube|Twitter
Retired Omnimaga admin (2001-11) and editor (2012-14)
??? ??? ??? ???

Offline Duke "Tape" Eiyeron

  • Urist McEiyolobster
  • Super User
  • Join Date: Nov 2014
  • Location: (V)(-_(//));(V)
  • Posts: 1636
  • Post Rating Ratio: +11/-2
  • Fanciest Walrus of the oceans.
    • @@Eiyeron
    • Eiyeron
    • /u/Eiyeron
    • Eiyeron
    • View Profile
    • Rétro-Actif : Rétro/Prog/Blog
  • Gender: Male
Re: Game engine structure
« Reply #7 on: March 29, 2015, 02:42:34 pm »
HBE is still (hypothetical) battle engine. Imean the parts which  make a boss change racto to attacks, change its M.O. when evetns are met or thngs like conversation or things inside  battle.
  • Calculators owned: A lot.

Offline DJ Omnimaga

  • Omni founder & CW co-founder
  • CodeWalrus Staff
  • Super User
  • Forum Maintenance
  • Original 5
  • CodeWalrus Supporter
  • *
  • Topic Management
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 17827
  • Post Rating Ratio: +89/-4
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • View Profile
    • DJ Omnimaga music store
  • Gender: Male
Re: Game engine structure
« Reply #8 on: March 31, 2015, 10:12:15 pm »
What do racto and M.O mean? As for battle convos, I usually just split boss fights into multiple parts and had the entire battle program exit without clearing the screen in order to perform special tasks such as boss convo.
  • Calculators owned: TI-73, TI-80 (broken), TI-81, TI-82, TI-83, TI-83+ (broken), TI-83+ (broken), TI-83+SE (broken), TI-84+, TI-84+CSE, TI-84+CE, TI-85, TI-86, TI-89T, TI-92, TI-Nspire, TI-Nspire CX (semi-broken), HP 39gII, HP Prime, Casio fx-7000G, fx-7400G+, fx-7700GE, fx-9750G+, fx-9750GII, fx-9860G, cfx-9850G, FX-1.0+, fx-CG10, fx-CP400
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nexus 5, Atari 2600, Lynx, SMS, Game Gear, Genesis, Dreamcast, NES, SNES, N64, GCN, Wii, Wii U, GBA, DS, 3DS, PS2, PS3, PS4, PSP, PSVita, XBox 360, XBOne

Bandcamp|Reverbnation|Facebook|Youtube|Twitter
Retired Omnimaga admin (2001-11) and editor (2012-14)
??? ??? ??? ???

Offline Duke "Tape" Eiyeron

  • Urist McEiyolobster
  • Super User
  • Join Date: Nov 2014
  • Location: (V)(-_(//));(V)
  • Posts: 1636
  • Post Rating Ratio: +11/-2
  • Fanciest Walrus of the oceans.
    • @@Eiyeron
    • Eiyeron
    • /u/Eiyeron
    • Eiyeron
    • View Profile
    • Rétro-Actif : Rétro/Prog/Blog
  • Gender: Male
Re : Game engine structure
« Reply #9 on: April 01, 2015, 08:12:24 am »
reactions* Modus Operandii* (the way it acts)
  • Calculators owned: A lot.

Offline DJ Omnimaga

  • Omni founder & CW co-founder
  • CodeWalrus Staff
  • Super User
  • Forum Maintenance
  • Original 5
  • CodeWalrus Supporter
  • *
  • Topic Management
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 17827
  • Post Rating Ratio: +89/-4
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • View Profile
    • DJ Omnimaga music store
  • Gender: Male
Re : Game engine structure
« Reply #10 on: April 02, 2015, 06:30:27 am »
Ah ok thanks for clarifying >.<. I assume by reactions you mean for example when the boss reaches a certain amount of HP and counter-attacks to specific spells? In Mana Force for example Boss 6 will not use Poison spell until he gets under 8000 HP, but since that's the only boss in the game that does that I didn't bother making it part of the engine. If I was to make a game where such event is a common occurence it would definitively not be hardcoded. >.<
  • Calculators owned: TI-73, TI-80 (broken), TI-81, TI-82, TI-83, TI-83+ (broken), TI-83+ (broken), TI-83+SE (broken), TI-84+, TI-84+CSE, TI-84+CE, TI-85, TI-86, TI-89T, TI-92, TI-Nspire, TI-Nspire CX (semi-broken), HP 39gII, HP Prime, Casio fx-7000G, fx-7400G+, fx-7700GE, fx-9750G+, fx-9750GII, fx-9860G, cfx-9850G, FX-1.0+, fx-CG10, fx-CP400
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nexus 5, Atari 2600, Lynx, SMS, Game Gear, Genesis, Dreamcast, NES, SNES, N64, GCN, Wii, Wii U, GBA, DS, 3DS, PS2, PS3, PS4, PSP, PSVita, XBox 360, XBOne

Bandcamp|Reverbnation|Facebook|Youtube|Twitter
Retired Omnimaga admin (2001-11) and editor (2012-14)
??? ??? ??? ???

Offline Duke "Tape" Eiyeron

  • Urist McEiyolobster
  • Super User
  • Join Date: Nov 2014
  • Location: (V)(-_(//));(V)
  • Posts: 1636
  • Post Rating Ratio: +11/-2
  • Fanciest Walrus of the oceans.
    • @@Eiyeron
    • Eiyeron
    • /u/Eiyeron
    • Eiyeron
    • View Profile
    • Rétro-Actif : Rétro/Prog/Blog
  • Gender: Male
Re : Game engine structure
« Reply #11 on: April 02, 2015, 07:34:23 am »
Yeah, that's absolutely what I want to do, but I want to make as flexible as I would (and boy, I need o do so much things)
  • Calculators owned: A lot.

 


You can also use the following HTML or bulletin board code to share it on your page or forum signature!


Also do not forget to check our affiliates below.
Planet Casio TI-Planet Calc.news BroniesQC BosaikNet Velocity Games