Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (527)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (594)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Concepts of a game engine/main loop  (Read 805 times)
0 Members and 1 Guest are viewing this topic.
Offline ThatProgrammer

Junior Newbie





« Posted 2013-11-18 19:57:26 »

Hi there,

From what I understand, a game loop checks for input, updates the objects and draws everything on the screen.

Are these components all in 1 thread or multiple? I thought the best way is to handle these all in a seperate thread.

Does anyone have source code/structure of a game's engine? Is my way a good way to handle these things or shall I just keep it in 1 simple main loop?

Kind regards,
Offline saucymeatman
« Reply #1 - Posted 2013-11-18 19:59:46 »

Well how do we know what "your way" is?
Check out MERCury, or other engines people are developing on here.
Offline ClickerMonkey

JGO Coder


Medals: 20


Game Engineer


« Reply #2 - Posted 2013-11-18 20:00:22 »

I wrote a pretty extensive article on my blog, http://www.gameprogblog.com, check it out.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Online trollwarrior1
« Reply #3 - Posted 2013-11-18 20:11:46 »

If you're just starting out, don't think about multi-threading. First off all, you should be able to get off with 1 thread if you're not making some game with super awesome graphics like AAA. 1 thread should always be enough. You should add another thread for loading stuff if it takes a lot of time.

In all, just do everything in 1 thread. If you're starting out, don't think about performance. Just do as much stuff as you can leaving performance behind. I bet 100% you will almost never run into huge performance issues, unless it is something really stupid.

Again, just do as much stuff as you can, ignoring performance.
Offline wessles

JGO Wizard


Medals: 74
Projects: 4
Exp: 4 years


Radirius Software


« Reply #4 - Posted 2013-11-18 21:14:03 »

Quote
I have an issue... I have been trying to get it to work for hours!
Oh, have I an idea!
I use Threads! great threads multi-Man, I draw threading %epera6te eeeeeeeeeeeeeee

*I always kept this advice heart. Found it on a thread from Jimmt, Riven, or some Duke.

Offline ctomni231

JGO Wizard


Medals: 99
Projects: 1
Exp: 7 years


Not a glitch. Just have a lil' pixelexia...


« Reply #5 - Posted 2013-11-18 21:30:45 »

Are these components all in 1 thread or multiple? I thought the best way is to handle these all in a seperate thread.

Game Threading

Pretty old topic on threading, but it still is spot on when it comes to writing any sort of application or game. It takes a lot of skill to get speed out of multi-threading, so if you don't understand it then it is probably best to stick to 1 thread.

Does anyone have source code/structure of a game's engine? Is my way a good way to handle these things or shall I just keep it in 1 simple main loop?

As for game engines, as far as I know, there is a lot of ways to design an engine. It is just a set of tools and modules catered for one purpose. So, the best way to design an engine is just to keep your tool set modular, so you can use the engine in many different ways.

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

PocketCrafter7 (12 views)
2014-11-28 07:25:35

PocketCrafter7 (8 views)
2014-11-28 07:25:09

PocketCrafter7 (8 views)
2014-11-28 07:24:29

toopeicgaming1999 (75 views)
2014-11-26 06:22:04

toopeicgaming1999 (65 views)
2014-11-26 06:20:36

toopeicgaming1999 (15 views)
2014-11-26 06:20:08

SHC (29 views)
2014-11-25 03:00:59

SHC (27 views)
2014-11-25 02:53:45

Norakomi (32 views)
2014-11-25 02:26:43

Gibbo3771 (28 views)
2014-11-24 10:59:16
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 13:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 13:36:02

List of Learning Resources
by Longor1996
2014-08-16 01:40:00

List of Learning Resources
by SilverTiger
2014-08-05 10:33:27

Resources for WIP games
by CogWheelz
2014-08-01 07:20:17

Resources for WIP games
by CogWheelz
2014-08-01 07:19:50

List of Learning Resources
by SilverTiger
2014-07-31 07:29:50

List of Learning Resources
by SilverTiger
2014-07-31 07:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!