Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Member Since 18 Nov 2013
Offline Last Active May 08 2014 05:40 AM

Posts I've Made

In Topic: Object interactions in a multithreaded game

28 November 2013 - 02:01 AM

This is very interesting, I appreciate all this information. 


One thing I am taking out of this is that high level gameplay logic is not something that I really need to do multithreading on. I suppose were it would be most beneficial is when a certain function is called that carries out  a low level taxing process. This particular process can then be broken down into "tasks" which can be put in a queue for the thread pools to process. In my head I am imagining this to give me much more precise control over what processes are multithreaded and which not.


I also like this idea of removing interaction between objects until computation is complete and then sending queued messages to objects. I have learned much!

In Topic: Singletons in a component based architecture.

26 November 2013 - 02:26 AM

Where does currentLevel come from? Is it a global variable?


Yes, yes it is. One of the very few in fact.

In Topic: Singletons in a component based architecture.

25 November 2013 - 06:52 PM

The fact that you can pass any lua_State you want into your functions means that you could easily create two, zero, or four thousand lua_states and use all of them (or none of them) freely. This is the exact opposite of what a singleton is meant to accomplish.


Ok well this is good. So its not the end of the world to just drop in a bunch of free functions organised in namespaces? I shall proceed doing that then.


If it is the case that its not the end of the world I'd like to add why I thought it might be. I often come across experience c++ and OOP programmers who preach using classes and OOP and using all the features of the language. I thought maybe there might be a better way to go about it than just using free functions, or functions wrapped in a class instead of a namespace.

In Topic: Singletons in a component based architecture.

25 November 2013 - 05:26 PM

I'm assuming this is basically what you're doing when you call into lua - passing a block of data for the lua script to operate on.


Not quite, most of the code looks like this:

int SetPosition(lua_State* L) {
    int entity = (int)lua_tointeger(L, 1);
    double X = lua_tonumber(L, 2);
    double Y = lua_tonumber(L, 3);

    currentLevel.GetEntity(entity)->trans.SetPosition(Vector2((float)X, (float)Y));

    return 0;

This function can be called from Lua, and most of the code is functions like this, that are called from a single Lua state. Currently there is only one Lua state, and so all the functions work of the single Lua state, like a singleton.

In Topic: Should I open source my engine?

22 November 2013 - 03:13 PM

This is all interesting stuff, and I tend to agree with most of it. I would like to clarify something though. I have no intention of becoming rich from making and selling a game engine, the only reason I made it was to learn more about the tech behind games, nothing more. I only thought about selling it since I felt quite proud of it, and this is almost certainly due to the fact that I made it, not because it's the best engine ever made (it isn't).


Taking in your thoughts, I will probably make it open source, but only after using it myself to make a game that I will sell (I am a game dev after all). This way when I release the source code it will be proven, and besides, making a game with it is probably the best test of it's abilities I can undertake. It will force me to improve it in ways that make it good at making games, then I will release it.


I thank you all for your input!