Refers to ways of organizing code, so it can be easier to work with.

learn more… | top users | synonyms (1)

0
votes
0answers
36 views

Proper 2D game engine architecture? [closed]

I have made a game engine in C++ before, but it was bad. The game logic was tied to frame rate, everything was. It could only run at one resolution, I had a central "Game" singleton, and used a lot of ...
1
vote
1answer
36 views

Rendering a dynamically sized box

So in games where there are textboxes with different sizes appearing, how does one actually render them efficiently? Games like Final Fantasy IX have dynamically sized speechbubbles for example, each ...
1
vote
0answers
44 views

How to learn game development when i understand the concepts but don`t know how to implement? [closed]

I have a basic level of programming knowledge, gained trough high-school classes and personal interest and also understand certain game design patterns like game loops, collision detection etc. My ...
2
votes
1answer
81 views

What's the difference between PS3 and PS4 code? [closed]

I am specifically interested in the differences between the game code as well as platform specificity. Can PS3 games be played on PS4 with no adaptations? Would we port over all assets from PS3 to PS4 ...
3
votes
3answers
105 views

Is it a bad practice to add helper methods if the class is intended only for data? [closed]

For example, if I have something like: class ItemData { public int cost; public int level; ... public List<ItemData> childItems; } And I'm aiming to separate ...
1
vote
1answer
27 views

Separating .js elements/ .js element communication

So I have 2 questions regarding the code below: function goldClick(number){ gold = gold + number; document.getElementById("gold").innerHTML = gold; }; function buyMiner(){ ...
-2
votes
4answers
118 views

Structure for online game server

i'm trying to write a server for my little game and i'm wondering about server structure. Let me explain that. Let's say i will create game in which you could edit skill stats, character basic stats ...
0
votes
1answer
76 views

What are some good namespaces for gameplay code? [closed]

I always struggle with naming namespaces when working in a team. I'd be very thankful if someone could share your preferred way of namespacing gameplay code? At least the root namespaces. Edit: As ...
3
votes
1answer
70 views

Separating rendering from HWND

I'm considering separating my game simulation from the message loop. It seems odd to me to have other systems tied directly to the window in which my game is running. Most examples I see are ...
3
votes
2answers
365 views

Is it a terrible practice to NOT initialize an object in its constructor?

I'm currently working on my own game engine, more precisely on the resources management part. For now, most of my assets inherits of the following - simplified - class: class Asset { public: ...
1
vote
1answer
49 views

Animations with Model View Controller

I'm currently wondering how to properly structure game code. I have come across MVC (Model View Controller) method/approach, which seams to be a decent way to get a good extendable structure. ...
0
votes
2answers
65 views

How are Objects rendered or updated, when there's a Pool class?

I have a State (Title State for example), that has the ResourcePool (getImage();getSound(); etc.) and a list of the GameObjects. How do GameObjects get access to the Resources in the Pool they need? ...
4
votes
2answers
94 views

Where to put the screen dimensions to make it accessible for all on screen objects?

I'm starting game development to learn a new language (SDL2, C++) and would like some opinions on the best way to handle a probably very basic problem. I don't want my player to go off screen, so I ...
2
votes
1answer
128 views

How to avoid lots of ugly math code and constants-hoarding?

In a lot of the games I've (tried) making in the past, I often run into the problem of the code getting really heavy on ugly mathematical code. This happens especially frequently in setting up ...
1
vote
2answers
242 views

Proper way to handle Movement/Animation/AI functions of an AI character in Unity3D

My team is currently building a 2D game in Unity and we've run into some workflow/script organization blockades for many of our game's characters. For example, we're not sure what the standard method ...
1
vote
1answer
75 views

Linking maps in Java game

In my Java game, I've got a number of randomly-generated maps made of tiles. I'm struggling with writing the code to handle the entering/exiting of the maps. Originally, I only had Ascend and ...
12
votes
4answers
2k views

How do you allow networking code to be written in the later stages of the development?

I'm currently in the early progress of writing a game which I eventually will want to improve in most aspects. How can I skip out on writing network code yet leaving it fairly easily implemented, that ...
0
votes
1answer
52 views

a shader type class in c

Is it possible to setup something sort of like a class in C++ but in c in the simplest terms? I want to avoid using c++ but I would like to create a simple struct that has glsl shader program. for ...
0
votes
1answer
113 views

How to make “Events”/ Scripted Scenes

I want to make cutscenes etc, in my game. I thought of a similar System like in the RPG Maker: If you enter a certain Area, a list of commands and arguments is played. E.g. like this: [Move ...
1
vote
1answer
131 views

Server networking - Thread per player

As my game is purely multiplayer, online performance is important. Should I run two threads for each player/connection? (One for input and one for output) or should I run one thread for all player ...
1
vote
2answers
93 views

Making an organized rendering class [closed]

I'm using LWJGL (opeengl wrapper for Java) and Don't know how to make a renderer class for OpenGL. So In Immediate mode rendering I'd do a method like this to draw quadralaterals. public static void ...
2
votes
0answers
105 views

How is game logic usually distributed around files [closed]

I don't know if this is a problem with game engines, but from the code I've seen in tutorials and open source projects, I can easily be confused by the layout of their code. For me, the code I made ...
0
votes
1answer
76 views

Race OOP structure [closed]

I am on a point that is totaly making troubles to me. In my "Test Program" I have a Character. This character have some stuffs (hp mp, weapon, attackPoint, armor, ...) but also a Race, that can be 4 ...
0
votes
2answers
123 views

How to hit an enemy, or “how do entities interact with each other?”

The title might be a tad simple for the purpose, but bear with me. I'm a tad lost about how to do the interaction between game objects. I use an entity-component-system framework and I've got the ...
1
vote
1answer
169 views

Component-Entity Systems Code Generation [closed]

I'm really enjoying component entity approach (I'm currently using ASH haxe, but particular language/framework doesn't really matter). However the problem is - there're way too many elementary ...
47
votes
8answers
8k views

How can I avoid having many singletons in my game architecture?

I use cocos2d-x game engine for creating games. The engine already uses many singletons. If someone used it, then they should be familiar with some of them: Director SimpleAudioEngine ...
1
vote
2answers
1k views

Unity - Avoid using Find method by caching UnityObjects - Code review

I'm trying to avoid using GameObject.Find during runtime to find particular GameObject components when wanting to instantiate them. I have created a cache for the gameobjects from which I can either ...
5
votes
2answers
254 views

Is having a master builder object a bad idea?

I have wondered about using the following approach to creating Entity objects in a personal project. What I want is to be able to keep track of all Entity objects that get created, so whenever an ...
0
votes
1answer
548 views

Game Structure in depth [closed]

I've been curious about game structure for some time now. Does everyone who is a game programmer come up with there own approach to structure there game, or is there like some sort of defined layout. ...
2
votes
2answers
198 views

Events vs Pinging: How should I structure my HUD-updating code?

I'm starting to develop a 2D fighting game using C++ and SMFL. I'm relying (at least sort of) on a Entity Design Pattern. I'm struggling to see how my code should update and manage a ...
0
votes
1answer
634 views

Tower defense endless levels logic sprite kit [closed]

I am making a tower defense game for iOS using Sprite Kit. I would like for my game to support an endless number of levels, like in Bloons TD 5. What approach should I take to implement this?
4
votes
3answers
261 views

When should I load my resources?

I'm making a game, and right now I'm working on the user interface. I'm just wondering when I should be loading my resources. Should I do it in small pieces at a time? Load resources for part 1 of ...
0
votes
1answer
946 views

Roguelike Map Structure [duplicate]

I'm working on a roguelike and would like to know how to structure my map data. I suppose this question could also be extended to any sort of top down 2d game. Anyways! My game will contain object ...
0
votes
1answer
278 views

Collision Detection Code Structure with Sloped Tiles

Im making a 2D tile based game with slopes, and I need help on the collision detection. This question is not about determining the vertical position of the player given the horizontal position when on ...
2
votes
1answer
504 views

Handling multiplayer operations in C#

I would like to know how do experienced c# developers structure their multiplayer messages and operations. Basically , in my project every UDP message is translated into an operation and I have to ...
1
vote
1answer
248 views

Handling Multiple Items Interaction (in a 2-Players Game)

Back Story I'm working on a 2-Players 2D game that players play multiple rounds ,until one win. In each round, each player choose some items (1 or more) for his/her car ( e.g. shield, anti-shield, ...
2
votes
1answer
117 views

Separating data from model and successfully visualizing it

This is a bit of a design question that I'm struggling with. I have a data model and an entity model. The data model is, of course, what is (de)serialized to represent my levels and entities within ...
4
votes
3answers
251 views

How to understand huge code bases? [closed]

I read about game loops, read tutorials of simple games like Asteroids and programmed them by myself. Nevertheless if I try to start reading code of a game with many many thousand lines of code, I ...
-2
votes
1answer
259 views

Game code structure using openGL / Android [closed]

My game will have 3 activities (splashscreen, options menu and main game). As it stands, each is a separate activity with it's own activity class and GLSurfaceview class. Is this structure the right ...
4
votes
1answer
331 views

LWJGL Eclipse Resource Deployment

I'm still experimenting with some OpenGL in LWJGL, and as I get to know more and more about OpenGL, I start to do more complicated things like multi texturing, shadowmapping and more. Now, right now ...
1
vote
1answer
639 views

How do I store multiple bullets' coordinates?

My game is a 2D game(or tries to be) in pure C using SDL(no OpenGL at all). No specific goal in it, it's pretty much boilerplate code. I decided I want to make my character/player shoot "something", ...
-2
votes
1answer
3k views

The best way to structure/design game code [closed]

My question is quite broad and related to the 2D game code design/architecture/structure. Usually the main game consists of the main loop where you update & render your world states. However, ...
2
votes
1answer
3k views

HTML5 point and click adventure game code structure with CreateJS

I'm a programming beginner. I made a tiny one scene point and click adventure game to try to understand simple game logic and came up with this: CreateJS features prototypes for creating bitmap ...
6
votes
3answers
418 views

Deleting a game object causing an access violation

I tried doing this but it cause an access violation. void GameObjectFactory::Update() { for( std::list<GameObject*>::iterator it=gameObjectList.begin() ..... (*it)->Update(); ...
9
votes
6answers
3k views

Game state management (Game, Menu, Titlescreen, etc)

Basically, in every single game I've made so far, I always have a variable like "current_state", which can be "game", "titlescreen", "gameoverscreen", etc. And then on my Update function I have a ...
0
votes
1answer
353 views

Structuring various game states and unique levels

I have a game design 'structure' question that I'd like to throw out there. This question is about various ways of designing game 'states', and specifically a system of 'levels'. Specifically, what is ...
0
votes
1answer
2k views

Interactions between game objects

I'm programming a basic Pacman clone to teach myself game programming. However, I'm struggling with the best way to have the game objects communicate/interact without my code becoming a huge mess. ...
6
votes
2answers
1k views

Observer Pattern Implementation

To teach myself basic game programming, I am going to program a clone of Pong. I will use the Observer design pattern, with an interface between the input and the game engine. However, I'm not sure ...
4
votes
3answers
908 views

How do I do a game loop in c99?

I'm having trouble with how to structure a game using c99. I've seen a few tutorials on making a game loop, but they are all done with c++ and classes. My main problem seems to be moving data around ...
10
votes
1answer
266 views

Efficient solution for multiplayer space partioning?

This question is a little tricky, but I will try to make it clear. Lets say I am building an online game (not MMO-scale), but that supports as many players as possible, in a authoritative server ...