Advertisement

I need some advice planning my first game

Started by March 08, 2022 04:32 PM
18 comments, last by GeneralJist 2 years, 8 months ago

I'm thinking to go 3D since the beginning. About that, I'm reading something about animating characters trying to figure out what's needed to learn.

Going on to think about SFML at the moment, it seems I have understood that SFML cannot directly animate 3D models as instead it can animate 2D sprites. Should I rely on OpenGL scripts for that? And which format should the models be? Would .fbx be fine?

Which are the things I should learn for animation?

Alhazred said:
I'm thinking to go 3D since the beginning. About that, I'm reading something about animating characters trying to figure out what's needed to learn.

Probably the hardest part of 3D.

You need to understand the math related to representing spaces in 3D. Which is linear algebra of vectors and points (vec3), and matrices to represent orientation and scale (3x3 matrix) and translation (4x4 matrix).
Next you need to understand how to work with such spaces in a hierarchy formed by the skeleton, so lifting an upper arm also rotates the lower arm, hand, and fingers accordingly, because they are child nodes of the upper arm.
Usually you represent each bone with a 4x4 matrix, and multiplying the child matrix with the parent transformation gives this result as expected.
The bone matrices can then also transform the skin vertices. We can use a linear combination of multiple bones per vertex to get some smooth skinning also on joint regions.
(I'm not sure if SFML has 3d data types like vec3, vec4, matrices, etc. If it's missing you can use another library like GLM, or use another framework which has it. DirectX has this math lib stuff included, but OpenGL has not. And both APIs use different conventions or row vs. column major order, which can cause some confusion when looking at tutorials using the other convention than you do.)

The hardest part here is usually getting used to 3D rotations, which are much harder than in 2D. Beside matrices, quaternions are a common and nice tool specifically about rotations.

Character animations are basically about such 3D rotations and rarely contain other data. Bone positions emerge entirely by rotating the joints of the skeleton accordingly to the data.
We can interpolate multiple animation clips at runtime to deal with discontinuities and transitions, but often the result looks kinda bad or inaccurate in practice, which can be addressed using inverse kinematics, e.g. to constrain a foot to the floor, or a hand to some handle, or to aim a gun. That's already some geometrically challenging problems to solve.

As a one man game developer, so far i never released a game using 3D character animation. It's really a hurdle. Making good animation manually is difficult, time consuming, often impossible.
And likely you don't want to do motion capture like AAA does to solve it, nor do you want to pay professional artists to help out.
So, for a first city building game, i'd try to limit it or avoid it completely.
Contrary, drawing 2D pixel art animations isn't easy either, but much more doable. Probably the main reason indie games use mostly pixel art.

That said from the perspective of content generation. Learning the math on the other hand is totally worth it and essential, if you aim for serious 3D game dev.
But the best advise always is: Start small. If you aim to high, you won't finish your first game. Which is not so much of a problem if learning is your top priority.

Advertisement

Download Unreal Engine, Unity and perhaps Godot. Try some simple prototyping in them and get a sense for how things are done. Look at some tutorials or courses for grasping the basics. Read up on what features they have/lack. Then just pick the one you like best.

Even as a programmer you will get used to using the editor to solve a lot of problems visually without code. Don't let that worry stop you.

Edit: This assumes that you are interested in 3D (which I think you are if I undestood you correctly?) and that you are interested in creating games and not technology primarily. If you are into 2D then there are tons of good options and writing your own engine is much more feasible. If you want to create gaming technology then you should probably start with the graphics APIs (or any part of game engines that interest you the most).

Just thought about voxels: https://ephtracy.github.io/#ss-carousel_ss

Content creation is more like generating pixel art but would work well for buildings. Rendering is 3D.

There are also animated voxel characters, basically 3D sprites, like shown in this game: https://www.youtube.com/watch?v=ZWsUxlnNCbc

Artstyle is usually cutesy, but if you like that surely an option.

Alhazred said:
I must say that I did prefer the SFML way

Alhazred said:
Do you think I should choose or try anything different? SDL2, which I only heard about, in example o other?

SDL2 is better for mobile development for Android and iOS. Just try to find tutorials on YouTube like: sdl android, sfml android, sdl ios, sfml ios and you will see the result - SFML does not support building for Android and iOS officially:

With SFML, your application can compile and run out of the box on the most common operating systems: Windows, Linux, macOS and soon Android & iOS.

“soon” is for a lot of years.

If you are a web developer why do you not look for WebGL 2D frameworks like Phaser, Pixi.js, Construct3, Cocos2d-html5 and so on?

JoeJ said:
Probably the hardest part of 3D. […]

In the game I have in mind I will not need to go that deep in the animation, just people walking around, doing some kind of job, maybe fighting, but just as you can see in a game like Banished or similar. Going on getting info, I've seen that it is possible to find 3D models of characters including .fbx animations. Would it be that hard as well to use them with SFML? What should I need to use them?

Advertisement

perry_blueberry said:
Download Unreal Engine, Unity and perhaps Godot.

I have already tried Unity, I'm now giving a look at Godot.

Alhazred said:
Would it be that hard as well to use them with SFML? What should I need to use them?

There is a library ‘AssImp’, which can import fbx. You upload the imported mesh and textures to GPU.
Then, per frame you need to convert animation to a skeleton pose on CPU, and upload the bone matrices to GPU as well.
Finally you a need a GPU vertex shader to skin the vertices, and a pixel shader to render the triangles (applying lighting and texturing).

OpenGL tutorials here. Doe not address animation, though. But good resource in general: https://learnopengl.com/Model-Loading/Assimp

Alhazred said:
In the game I have in mind I will not need to go that deep in the animation, just people walking around, doing some kind of job, maybe fighting, but just as you can see in a game like Banished or similar.

While this game shows only small characters doing basic actions, it still has the whole animation and rendering pipeline running, including all the complexity i have mentioned. They probably use no IK or animation blending, but all the rest is there.

Implementing all this might take you something like a year, to make a wild guess. You'll learn all the basics. On the other hand, using an engine you can start working on the game immediately and learn stuff as needed on your way.

I don't recommend one way over the other. I'm definitively one of the ‘do all yourself’ guys, but i had no choice back then. In current time most people use engines, and also get started this way.

There is also a middle ground of learning from looking at how your chosen engine works. Notice not all engines provide source code for free, e.g. Unity does not. This means you fully depend on them, and after many years you might no longer be able to build / update your game, because you do not have all the source. The old engine might no longer run on future OS and computers. That's why i personally rule those options out.

As my first attempt, I'll try to make this game using an engine, I'll use Godot.
I certainly have a lot to learn about game development, let's say almost everything, and it will help to not be tempted to give up.

Once more experiences I'll see if I will want to have more control and make a game using a framework.

Thank you all for the suggestions.

So cuz i don't have time now, I'm skipping my SOP for forums and not reading all the past comments. It used to be a horible OCD thing i had, needing to be up to date and not repeating anyone else but anywyas,

So my advise?

  1. keep it small
  2. write a GDD
  3. recruit a team
  4. work at your own pace, unless other priorities come into play.
  5. pick an engine and stick with it
  6. do your own research
  7. never let anyone tell you it's impossible
  8. only give up if your health is telling you to
  9. Share your idea as far and as freely as you can (no one will steal your idea, and make it for you)
  10. talk and document your process, procedures here, on your own site, blog or wherever.

Our company homepage:

https://honorgames.co/

My New Book!:

https://booklocker.com/books/13011.html

This topic is closed to new replies.

Advertisement