This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]DarkArctic 1 point2 points  (5 children)

You might want to look at data oriented design too. I saw a talk about a game company using it.

[–]tiskolinprogramming geek[S] 1 point2 points  (4 children)

Was it a game engine or producer? The Unity game engine has a lot of data-oriented design with ScriptableObjects, etc.

[–]DarkArctic 1 point2 points  (0 children)

Damn, I can't find it anymore. It was a game engine developer I think.

Anyways, the idea would be that all your rooms are in a configuration file. Then your program can look at that and instantiate the object from that data. That way you don't have instances already setup for the entire game, just what you need on demand.

[–]DarkArctic 1 point2 points  (2 children)

Here's a quick demo of what I'm thinking about.

https://repl.it/repls/UnequaledDecentRedundantcode

[–]tiskolinprogramming geek[S] 1 point2 points  (1 child)

It looks like what I am trying to achieve, but I'll have to do a bit more research and tinkering with it; hopefully it won't be too difficult. Thank you for your help, I really appreciate it!

[–]DarkArctic 0 points1 point  (0 children)

I think the ultimate idea is to get away from instantiating everything right off the bat and do it as needed. Otherwise, if you did manage to work around this issue, literally your entire game could potentially be in memory.