Frame rate – How to create an FPS game?

I want to know how to create an fps game with SDL lib?

Are there any books that can be explained with examples?

This wins most open-ended questions. You can write a book. But let us rest assured Pointing in the right direction…

The first step, you need good debugging skills for such a project. Choose Steve McConnell’s code to complete. Read the whole thing. The time invested is more than There are more things you can read/test.

Get some source code for some games. Any game. Make sure you see something simple before you see something big and complicated, and when When you see any game code they may have, remember that they can give you more time to enter it. The point of this point is to look at the code structure.

Get a reference for 3D math, You don’t have to go deep, but you need to know the things before and after the product, and be able to figure out how to create a matrix for your camera in the world. (even if you write 0% rendering code)

(edit) This is a good book about 3D mathMathematics for 3D Game Programming and Computer Graphics, Second Edition (Game Development Series). This is not the kind you learn in college, it is more like a triangle and more advanced practical concepts Intersection: How to create a toolbox for yourself with simple physics, efficient collision detection, etc.

You need to know about rendering and pipelines. SDL provides you with support, but please make sure you understand what it is. The concept of what to do.

Read about the actual system design. Your various systems must be interlocked. Think about it. Your system is just a good one in C or C, it’s you The idea of ​​how your data/control will be calculated, not how you perfectly simulate design patterns (although these are very useful and rough)

The basic knowledge of artificial intelligence is not “real” artificial intelligence, but Functional artificial intelligence; there is a big difference. The state machine is easy to start and is good enough for simple FPS.

Learn about estimation and planning. You don’t have time to do anything you want to do Come to make FPS correctly. You will have to classify and learn how to classify; they are two different things, the latter is difficult. Experience is the best teacher here. (Although the legendary McConnell also has this Book)

There is a system to insert your gameplay into the level. If you are just a programmer, then the best way is to write a plug-in for an existing editing program (such as 3DS Max) I highly recommend Max over Maya as a programmer. The Maya script is very good, but it is more Suitable for smart non-programmers. I find that 3DS Max thinks more about how programmers create and edit your world.

You can spend YEARS authoring tools to allow you to do this correctly, so you want Perform operations in a way that can be edited quickly and accurately
If you make your own editor, please incorporate it into your game world.
If your world is not truly 3D and you want to quickly improve your level, You can save your level data as something like this, which will save you a lot of time
where X is a wall, other letters are game objects, and a simple dirt parser can be converted into game objects and world coordinates
p>

xxxxxxxxxxxxxxxxxxxxxxxx
xx..........P..........x
xxxxxxx..... ......I....x
xR....xxx...........E..x
xx........ .........0xxxx
xxxxxxxxxxxxxxxxxxxxxxxx

But it all depends on your game. My point is that you will need to ask for help from “slum coding” how to convert your The transfer of game data to your world is very important. You need to consider something that is implemented quickly and cooperates with you quickly.

Why does it boil down to your goal? If you want to learn to write code in an absolutely correct way, expect to spend most of your time iterating on code that looked good a month ago, but now that you have realized what your requirements are, it can really use another pass. Don’t be afraid Rewriting, you know a lot by doing this, but if your goal is functionality, you may need to figure out where to hack something (such as embedding gameplay data and coordinates into code files) can be hacked, as long as you know you Where to attack, and carefully separate it from your good code, so you can go back and write the code correctly when you have the opportunity.

Most importantly, you need to make sure your goal is What, study or function, and find a happy medium in between.

I want to know how to create an fps game with SDL lib?

Are there any books that can be explained with examples?

This wins most of the open-ended questions. You can write a book. But let us be at ease pointing in the right direction…

The first step, you need good debugging skills for such a project. Choose Steve McConnell’s code to complete. Read the whole thing. It takes more time than you can read/test anything.

Get some source code for some games. Any game. Make sure to see something simple before seeing big and complicated things, and when you see any game code they might have, Keep in mind that they can give you more time to enter it. The point of this point is to look at the code structure.

Get a reference of 3D mathematics, you don’t have to go deep, but you need to know before and after the product Things, can figure out how to create a matrix for your camera in the world, etc. (even if you write 0% rendering code)

(edit) This is a book about 3D mathMathematics for 3D Game Programming and A good book on Computer Graphics, Second Edition (Game Development Series). This is not the kind you learn in college, it is more like an intersection between triangles and more advanced practical concepts: how to create a simple physics for yourself, Toolbox such as efficient collision detection.

You need to know about rendering and pipelines. SDL provides support for you, but please make sure you understand the concept of what it is doing.

Read information about the actual system design. Your various systems must be interlocked. Think about it. Your system is just a good one in C or C, it’s the idea of ​​how your data/control will be calculated, not How do you perfectly simulate design patterns (although these are very useful and rough)

The basic knowledge of artificial intelligence is not “real” artificial intelligence, but functional artificial intelligence; there is a big difference. The state machine is a good start, and is good enough for simple FPS.

Learn about estimation and planning. You don’t have time to do anything you want to make the FPS correctly. You will have to sort and Learn how to classify; they are two different things, the latter is difficult. Experience is the best teacher here. (Although the legendary McConnell also has books on this)

There is a system You can insert your gameplay into the level. If you are just a programmer, then the best way is to write a plug-in for an existing editing program (such as 3DS Max). I highly recommend Max over Maya as a programmer. Maya The script is great, but it is more suitable for smart non-programmers. I find that 3DS Max thinks more about how programmers create and edit your world.

You can spend YEARS to make Tools to allow you to perform this operation correctly, so you want to perform the operation in a way that can be edited quickly and accurately
If you make your own editor, please incorporate it into your game world.
If yours The world is not really 3D and you want to quickly improve the level, you can save your level data as something like this, which will save you a lot of time
where X is the wall, other letters are game objects, and the dirt is simple The parser can be converted to game objects and world coordinates

xxxxxxxxxxxxxxxxxxxxxxxx
xx..........P........ ..x
xxxxxxx...........I....x
xR....xxx...........E..x
xx.................0xxxx
xxxxxxxxxxxxxxxxxxxxxxxx

But it all depends on your game. My point is, You will need to ask for help on how “slum coding” transfers your game data to your world is very important, you need to consider something that is implemented quickly and works with you quickly.

It comes down to why you The goal? If you want to learn to write code in an absolutely correct way, expect to spend most of your time iterating on code that looked good a month ago, but now that you have realized what your requirements are, it can really use another pass. Don’t be afraid Rewriting, you know a lot by doing this, but if your goal is functionality, you may need to figure out where to hack something (such as embedding gameplay data and coordinates into code files) can be hacked, as long as you know you Where to attack, and carefully separate it from your good code, so you can go back and write the code correctly when you have the opportunity.

Most importantly, you need to make sure your goal is What, study or function, and find a happy medium in between.

Leave a Comment

Your email address will not be published.