/GD/ Gamedev thread

Can't recall the last thread. Post your resources and projects. Codelets need not to apply.

github.com/dbartolini/data-oriented-design
github.com/Calinou/awesome-gamedev
gameprogrammingpatterns.com/
realpython.com/tutorials/gamedev/

Some subjects to discuss:
- Lua or Python for scripting?
- Json, xml or yaml for config data?
- c++ or java for engines?
- Inhouse tools (mapping, ai) vs third party tools?
- Is the design doc dead?

Attached: 1.jpg (800x566, 128.31K)

there's a game dev thread on /vg/

how to simulate the feeling how speed in a racing game?

Physics... well, mechanics really. Buy, read and implement.

data oriented design is a cargo cult like OOP was in the 90s

Increase the FOV, add (very subtle) camera shake, motion blur.

What is the best way to organize code/functions during game development? As I make progress in my game I get worried that the code might become too big and scattered for me to work properly.

For reference, I'm working on a simple strategy game were units move around on hexagon tiles on Unity. Also if you know any good unity hexagon tile libraries please share, the ones I found haven't been great so I've been coding from scratch.

Attached: a9ae16b70b9c19ad2793cfd26b840fe4a122cf3f9539c669b416bcf9aad48454.jpg (3000x3846, 1.06M)

Doesn't Unity organize your code for you?

I'm very new to gamedev and unity in general so I haven't heard of that, I'll look it up. Currently I have a few "managers" which perform some of the operations of the strategy game. (unitmanager, mapmanager, ect...) What i mean by organize is some of these files are getting worryingly big.

increase velocity to make the car go faster

The best way to organize your files depends on your language and your engine, I don't know Unity and C# so I can't give specific recommendations
But my average file size is about 300 lines, each file typically does one thing, like contain one class and it's supporting classes
I've seen people who write 6000 line files but I find those very hard to maintain

ok this is Any Forums

how can I structure my code correctly when using something like raylib? should I make the 'engine' as a separate executable? or do I throw everything into one thing? planning to use raylib in C, Rust, or Go - not sure yet but Any Forums will tell me to use C

if the issue is only that the files are long you can use partial classes and define part of the logic in a different cs script.
that doesn't solve the actual issue though, which is that maybe your classes are a bit too bloated. maybe try composition. You can instantiate them in the Awake method some non MonoBehaviour classes that handle part of the logic of the manager and then destroy them on OnDestroy. This way they won't appear on the inspector and won't bloat the editor if they only handle internal logic

Use c++ also the engine should be a static library that you link against

The short answer is you break functionality up into smaller classes/organizational structures.

>should I make the 'engine' as a separate executable?
no

if you plan on learning C and or low level programming, go for c.
otherwise stay away from raylib (especially if you're not using the bindings for higher level languages like go, js, c#, python or even ruby). there's a reason why there aren't actual games made in raylib and it's cause if you try making something more complex than space invaders or tetris the amount of work is insurmountable

raylib is a good library for fucking around in, you shouldnt stay away from it just because you can't make a complex game with it

Thanks for the feedback frens

Attached: 1637191914178.jpg (458x1024, 72.47K)

as i said, if you wanna learn it's fine. if you wanna make an actual game stay away from it. i've seen many people (especially overenthusiastic and non experienced people, like you find on Any Forums) fuck around with low level apis for years and never amounting to anything. what's funnier is that they always try making the same fucking crafting/survival tech demo with no gameplay loops or original ideas

You could make an actual game with it so long it was 2D and not too complicated

I have a problem and I can't quite wrap my head around it beyond knowing its "turn based".

I have a long array representing game entities, and each entity has its own update() method ran on it that does all the magic. A loop goes through the array and updates everything.

The issue is bugs endlessly keep crawling out of there because it appears the order of the entities in the array affects their behavior when it shouldn't.

>a has 10 hp, shoots at the nearest enemy
>b has 10 hp, shoots at the nearest enemy
>array is ordered [a,b,...]
>a and b are in each other's range

In this scenario, the intended behavior is both enemies blowing themselves up after the loop is done, however, because a.update() is ran before b.update() it turns out a kills b and stays alive!

How can something like this be solved so that all entities act at the same time instead of one after the other? I've tried modifying the loop and the update methods to no avail.

as i said, space invaders or tetris - tier complexity

No, you could make a platform game, a roguelike, an RPG, a real game, so long as it was 2D and the graphics aren't too complex. It doesn't limit you, it just doesn't offer that much. Forget doing anything 3D with it

You need a two phase update
update then lateUpdate or whatever

You could make Enter the Gungeon with software rendering nigger.

try making an rpg using raylib. waste 5 years of your life and then redo all your systems in 5 days using unity, gamemaker or godot.

or something like a transaction, where all the changes (damages to be applied, etc) are created, then applied at the same time

It depends on what kind of graphics you want. If you have low graphical complexity, it's fine. Game engines do not help you with game logic