Leddyboo

2D What books should I get next? C++

Recommended Posts

Hello GameDev vets,

I use to program when I was younger (few college courses as well) and as I got older I got away from it. I've now been really taking learning programming very serious. I bought Sam's Teach Yourself C++ to learn the newer stuff added to C++ and refresh myself of all the basics. I am looking for the next book to help me actually start on a simple rogue RPG. I wish I could find a book (recent date) that covers heavily DirectX12 or 11 and RPGs. Especially procedural generation and tiles. I assume my book on Isometric programming still has relevant ways of doing tiles. Can anyone help me pick out 2-3 books that will help make me a comfortable windows programmer. 3D is probably my LAST stop. I just would really enjoy non outdated books regarding 2D RPG games (and eventually 3D). But I am trying to go through the stages in a more practical way. Price is not really an issue. Any other sources are great as well.

Thanks everyone!

I have the following books:

Sam's teach yourself C++(8th Edition)
|Beginning C++ Game Programming by John Horton
Beginning C++ Through Game Programming (4th Edition) by Michael Dawson
Game Programming Patterns
The Art of Game Design
Level Up

(Also own a kindle version of 2D programming by I forget who, it was great during its time)

OLD OUTDATED BOOKS:
Programming Role Playing Games with DX9
Programing Isometric Games with DX7 (maybe 9)
Programming Multiplayer Games

Share this post


Link to post
Share on other sites

I agree with @nbertoa what's your target.

Is your character moving about in a 3D world?

Do we see your character? Requires animation for your character as well.

What tool are you going to use for your models? Blender? I like Blender because there are lots of good YouTube tuts.

Jump into 3D rather than trying to force 2D to do what you want if you are aiming for anything other than tiles.

Assuming you goal is the game, rather than game engine development, look at some of the Game Engines out there. Unreal Engine, Unity. Probably a better investment of your time than trying to learn DirectX, also makes multi-platform simpler.

If you are a sucker for punishment then I'm working my way through this at the moment.

http://files2.syncfusion.com/Downloads/Ebooks/Direct3D_Succinctly.pdf

Scan through the beast below which will help you understand how to set up your project and what you are up against.

http://www.latexstudio.net/wp-content/uploads/2014/12/Game_Engine_Architecture-en.pdf first edition free. There is a second edition as well.

Don't get too fussed about learning everything there is to know about C++ that's what Stackoverflow is for, search for a solution to your problem.

You should also write a story about your character and world, a good story. It's the storyline that helps player to become immersed in your world.

The Game Programming Patterns book is good.

Read the Blogs on this site.

And above all else actually write the code in the tut's, copy the boiler-plate but actually type in key code. Actually working through the examples will help you build up the knowledge you are after.

Edited by timjohnarm
Additional info

Share this post


Link to post
Share on other sites

What is more important, Windows programming or your roguelike ? I would learn to get a basic skeleton D3D11 program up and running, that shouldn't be too difficult. From there I'd make a simple 2D game, like a grid-based one. After that things will start falling into place. I don't think you need any more books.

Share this post


Link to post
Share on other sites

Hi Leddyboo, 

Looks like you already have a few gems on your list.  I am really enjoying Level Up and Micheal Dawson Beginning C++ through Game Programming was good as well.  I think if you are going to proceed with C++ you should own a copy of "The C++ Programming Language" by Bjorne Stroustrup.  As far as your next steps in game development.  I think that before you delve deeper into programming you should clearly define what it is that you want to do, then direct yourself toward developing skill with the tools that will be most useful to you.

 

Share this post


Link to post
Share on other sites

Actually to take @Endemoniada's point a bit further, and to quote one of my favourite science fiction authors when asked about how to become a writer. "Start writing and keep on writing it's the only way to get better"

Share this post


Link to post
Share on other sites

If you want to learn C++, these are the 2 best books I've read (similar names but unrelated).

https://www.amazon.com/Primer-Plus-6th-Developers-Library/dp/0321776402/

https://www.amazon.com/Primer-5th-Stanley-B-Lippman/dp/0321714113/

Regardless of what API/engine you use, C++ skills are good to have. In terms of graphics, you have a few options. Realistically, going with an off-the-shelf engine will save a lot of time. However, it sounds like you are interested in learning, so writing the game on a lower level can be fun and rewarding (as well as extremely hard and frustrating). But if you keep your game to a limited scope, it is possible. 

You probably won't find a book specifically on making RPGs in DX12, so you will have to be inventive. Technically the API and game logic code are separate anyhow, so you don't have to learn them together. Get an RPG game book for any API or engine (even older) and then substitute whichever newer technology you want. The basics of game programming haven't changed much in years, so even a DX9 book will be useful if you ignore all the API calls. 

The most important thing is figuring out what you want to do. Is it to make a game? A game engine? Learning programming? Is it to tell a story? Build a portfolio? Have a fun hobby? Etc. That may give you an idea of what path to choose.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Forum Statistics

    • Total Topics
      627726
    • Total Posts
      2978816
  • Similar Content

    • By ScyllaBus
      Using my loop based on this: https://gafferongames.com/post/fix_your_timestep/
      Trying to get my game to run at fixed 60FPS (both update and render) for all machines. Studied the link above and have been stuck on this game loop for weeks trying to get it to work smoothly to glide this image across the screen. I had dealt constantly with jittering and possible tearing. I can't recall what I did to fix it exactly, but I believe it may have something to do with not rounding a variable properly (such as delta).
       
      So yeah, currently the loop works but I'm afraid as I develop the game more and have to render more, eventually something I'm doing in my loop could cause slowdowns or larger CPU usage. Does the structure of the game loop below seem okay or is there something I can do to optimize it?
      The 2D game is a generic sidescroller. Not too heavy on physics, mainly just simple platformer physics.
       
      void Game::mainLoop() { double fps = 60.0f; int frameSkip = 5; int deltaSkip = frameSkip; double miliPerFrame = 1000.0 / fps; double xx = 0.0f; double playSpeed = 5; Uint64 previous = SDL_GetPerformanceCounter(); double accumulator = 0.0f; bool shouldRender = false; bool running = true; while(running){ Uint64 current = SDL_GetPerformanceCounter(); double elapsed = (current-previous) * 1000; elapsed = (double) (elapsed / SDL_GetPerformanceFrequency() ); previous = current; // handleEvents() handleEvents(); // when we press escape reset x to 0 to keep testing // when he goes off screen if(key_states[SDL_SCANCODE_ESCAPE]) xx = 0; accumulator+=elapsed; if(accumulator >= miliPerFrame * frameSkip) accumulator = 0; shouldRender = accumulator >= miliPerFrame; while(accumulator >= miliPerFrame){ // update() //cout << playSpeed << endl; double delta = ceil(elapsed); if(delta > deltaSkip) delta = 1; //if(elapsed >= 1) delta = elapsed; xx+= playSpeed * delta;// * (1 / fps); // /update() accumulator -= miliPerFrame; //get what's left over } if(shouldRender){ // render() SDL_SetRenderDrawColor(gameRenderer, 0xFF, 0xFF, 0xFF, 0xFF); SDL_RenderClear(gameRenderer); imageController.drawImage("colorkeytest", floor(xx), 0); SDL_RenderPresent(gameRenderer); // /render() } } }  
    • By mrpeed
      I wrote Snake in Python 3 using Pygame and was wondering if anyone can do a code review of it? If this is the appropriate fourm to post such a thing?
      Some things to mention:
      1. I realize I could have used a dict in the place of my Segment class, but I decided to go with the class because it looked more clean to me.
      2. I used recursion heavily, though I could have used a list instead. I decided to do it recursively for practice and fun (I don't use recursion often). 
      3. I don't have doc strings for any of my functions.
      4. I probably could have used my get_all_snake_segment_locations function to avoid recursion.
      5. I set fps to 10 to limit the speed of the game. Is this a bad way to do such a thing?
      6. I attached an input manager I created and unit tests for my game for completeness. Though, I'm only asking the actual game to be reviewed, if you want to look at those you can. Also, note the unit tests are not complete yet for several functions I changed.
      7. I really appreciate anyone who takes the time to give me feedback of any kind. This fourm has been a huge help to me and I'm grateful for everyone's  insight!
      import sys import random import itertools import pygame import inputmanager class Segment: def __init__(self, rect, direction=None, parent=None, child=None): self.rect = rect self.direction = direction self.parent = parent self.child = child class Game: def __init__(self): pygame.init() self.fps_clock = pygame.time.Clock() self.fps = 10 self.window_size = (640, 480) self.displaysurf = pygame.display.set_mode(self.window_size) pygame.display.set_caption("Snake") self.cell_size = (32, 32) self.start_location = (320, 224) self.head_segment = Segment(pygame.Rect(self.start_location, self.cell_size)) self.up = "up" self.down = "down" self.left = "left" self.right = "right" self.black = (0, 0, 0) self.green = (0, 255, 0) self.red = (255, 0, 0) self.direction = None self.extender = None self.cell_locations = set( itertools.product( range(0, self.window_size[0], self.cell_size[0]), range(0, self.window_size[1], self.cell_size[1]) ) ) def main(self): while True: self.get_input() self.update() self.render() self.fps_clock.tick(self.fps) def get_input(self): inputmanager.InputManager.get_events() inputmanager.InputManager.check_for_quit_event() inputmanager.InputManager.update_keyboard_key_state() inputmanager.InputManager.get_keyboard_input() def update(self): self.handle_input() self.update_snake_direction(self.head_segment, self.direction) self.move_snake(self.head_segment) if self.extender is None: self.add_extender_to_board() if self.head_segment_collided_with_extender(): self.extend_snake() if self.game_over(): self.refresh() def handle_input(self): if inputmanager.InputManager.quit: self.terminate() if (inputmanager.InputManager.keyboard[pygame.K_UP] == inputmanager.InputManager.pressed and self.direction != self.down): self.direction = self.up elif (inputmanager.InputManager.keyboard[pygame.K_DOWN] == inputmanager.InputManager.pressed and self.direction != self.up): self.direction = self.down elif (inputmanager.InputManager.keyboard[pygame.K_LEFT] == inputmanager.InputManager.pressed and self.direction != self.right): self.direction = self.left elif (inputmanager.InputManager.keyboard[pygame.K_RIGHT] == inputmanager.InputManager.pressed and self.direction != self.left): self.direction = self.right def terminate(self): pygame.quit() sys.exit() def update_snake_direction(self, segment, parent_direction): ###TEST if segment.child is not None: self.update_snake_direction(segment.child, parent_direction) if segment.parent is None: segment.direction = parent_direction else: segment.direction = segment.parent.direction def move_snake(self, segment): self.move_segment(segment) if segment.child is not None: self.move_snake(segment.child) def move_segment(self, segment): if segment.direction == self.up: segment.rect.move_ip(0, -self.cell_size[1]) elif segment.direction == self.down: segment.rect.move_ip(0, self.cell_size[1]) elif segment.direction == self.left: segment.rect.move_ip(-self.cell_size[0], 0) elif segment.direction == self.right: segment.rect.move_ip(self.cell_size[0], 0) def add_extender_to_board(self): snake_segments_locations = set(self.get_all_snake_segment_locations(self.head_segment)) location = random.choice(list(self.cell_locations-snake_segments_locations)) self.extender = pygame.Rect(location, self.cell_size) def get_all_snake_segment_locations(self, segment): yield segment.rect.topleft if segment.child is not None: yield from self.get_all_snake_segment_locations(segment.child) def head_segment_collided_with_extender(self): return self.head_segment.rect.colliderect(self.extender) def extend_snake(self): self.extender = None self.add_segment_to_snake(self.head_segment) def add_segment_to_snake(self, segment): if segment.child is None: if segment.direction == self.up: topleft = (segment.rect.x, segment.rect.y+self.cell_size[1]) elif segment.direction == self.down: topleft = (segment.rect.x, segment.rect.y-self.cell_size[1]) elif segment.direction == self.left: topleft = (segment.rect.x+self.cell_size[0], segment.rect.y) elif segment.direction == self.right: topleft = (segment.rect.x-self.cell_size[0], segment.rect.y) segment.child = Segment( pygame.Rect(topleft, self.cell_size), segment.direction, segment ) else: self.add_segment_to_snake(segment.child) def game_over(self): return any([ self.head_segment_collided_with_self(self.head_segment), self.head_segment_out_of_bounds() ]) def head_segment_collided_with_self(self, segment): if segment.child is not None: if self.head_segment.rect.colliderect(segment.child.rect): return True else: return self.head_segment_collided_with_self(segment.child) return False def head_segment_out_of_bounds(self): if (self.head_segment.rect.x < 0 or self.head_segment.rect.y < 0 or self.head_segment.rect.x >= self.window_size[0] or self.head_segment.rect.y >= self.window_size[1]): return True return False def refresh(self): self.head_segment = Segment(pygame.Rect(self.start_location, self.cell_size)) self.direction = None self.extender = None def render(self): self.displaysurf.fill(self.black) self.draw_snake(self.head_segment) if self.extender is not None: self.draw_extender() pygame.display.update() def draw_snake(self, segment): pygame.draw.rect(self.displaysurf, self.green, segment.rect) if segment.child is not None: self.draw_snake(segment.child) def draw_extender(self): pygame.draw.rect(self.displaysurf, self.red, self.extender) if __name__ == "__main__": game = Game() game.main()  
      test_game.py
      inputmanager.py
       
      game.py
    • By MrGiratinaORIGINAL

      I'm the co-director of LM Team, a 7-member team currently constructing a fangame based upon the Mega Man series. We've been working for about 2 years now, and both of our current programmers are busy for the next 6 months or so. Because of this, we're currently looking for a programmer (or more) to take care of gameplay and animation programming. We already have a base system in place that may optionally be built upon. This will be a hobby project to invest your free time in, not a gamedev gig.
      We're currently about 67% done with the OST, 75% done with the design work, and 33% done with the graphical work. As such, the specifications of what we need should remain pretty stagnant from now on.
      Here's some links of our team's work, to give you an idea of what we're currently capable of achieving:
      Actual Y+1 Stuff:
      - Current public playlist of music
      - Old footage of the first boss of the game, since been altered slightly based on feedback
      - Mockups
      m9m (director, composer):
       
      - Grand Dad Reboot - Ominous Cavern
      - Lands of Onlup
      - Mega Man Revolution Remix - Wily 2
      MrKyurem (co-director, main designer, me):
      - Boil Man - 10th place in Make a Good Mega Man Level 2 Contest
      NaOH (programmer [not programmer who is currently working on the engine]):
      - Programmer for Make a Good Mega Man Level 2 Contest's release game (did co-op mode and leaderboard functionality)
      - 15 years of programming experience
      - Castlevania 3 controls romhack
      - GML code beautifier
      - Beat-Em-Up engine
      Alm (artist):
      - Cutscene for a personal project
      - Tileset for Boil Man's stage in MaGMML2
      - Concept sprite
      Valo (artist):
      - Jungle Man tileset in Mega Man SD
      - Boxart for Mega Man SD
      - Wily sprite
      Karakato (artist):
      - Robot Masters in BCA
      - Idol Woman
      - Stage Select for separate project
      Deathro (composer):
      - Through the Eye of a Prism - 2nd place in Famicompo 2015's Original category
      - Mega Man SFR - Wily 2
      - Geno Force - Silent Breeze
      Contact
      If you're interested in joining, I'd recommend signing up to Discord, as we almost exclusively communicate through this.
      Discord Tags:
      MrKyurem#8741
      m9m#1104
      Email:
      LMTeam.Y1@gmail.com
    • By tonemgub
      Hello,

      I’m writing research paper on software rasterization algorithms and at one point I gave example of triangle rasterization algorithm.

      The algorithm is really basic. If the triangle is flat top or flat bottom it’s possible to determine the minimum and the maximum x values for each scan line using the equation of line for the edges. Then for each scan line fill the pixels between minimum x and maximum x values.
      If the triangle is of other kind it’s possible to split it to flat top and flat bottom triangles (finding the fourth vertex) and draw it using the previous algorithm.

      I need to cite a reference for this algorithm. I saw it in some book in the ‘90s and I can’t just write it without a reference. The problem is that I can’t remember where I saw it.
      I already tried to look at “Computer Graphics: Principles and Practice” but the only similar algorithm there is the polygon rasterization algorithm, which is over engineered for this kind of problem, same with "Computer Graphics: C Version".
      I also tried to look at “Black Art of 3D Game Programming”, which have similar algorithm but the algorithm that I saw was in another book and slightly different.

      Anyone know a book with this kind of algorithm?
      Any help is appreciated.

      Thanks.

    • By Blue apple
      Hi, I am Blue Apple a novice developer in the group Cute Software, and I'm here to share with you our new game: "Shotgun Evolved", it's a top-down-shooter where you fight your friends (in the same computer) in a 2 to 4 players arena through different maps and game-modes

      -Controls: Every player got 6 keys (on the keyboard or on the controller), 2 to turn right or left, 2 to walk forward or backward, 1 to shoot and 1 to interact with objects, they are a bit hard to get used to, but this gives you an excuse for losing every time

      -Game-play: The goal is simple, "fight until the other players lose all their lives", you can lose a life in different ways depending on the game-mode (being killed, an opponent capturing an outpost...)

      -Items : There are 3 items, the 'up' item that is thrown by the players when they die which upgrades your shotgun, the 'heal' item that is dropped by bots(pirates,skeletons...) which heals you, and the 'life' item that spawns somewhere on the map every 10 s which gives you an extra life

      -Extra : You can change some settings before starting, like the number of lives, the speed of capture, deactivate players'names/objects/bots and activate "hyper speed" which makes everything two times faster

      Downloads (Windows installer):
      -Alpha 0.1.1: http://www.mediafire.com/file/437o7jap91g8lsp/Shotgun_Evolved__Alpha_0.1.1.exe
      Music by "Yahya" :
      -His youtube-channel : "Yaya drops", https://www.youtube.com/channel/UCmahZvO-m3b2Ib5318SmUHA
      -The game-menu's music : "Andy", https://www.youtube.com/watch?v=5zVMpu9oLnA
      Follow us on:
      -Facebook: https://www.facebook.com/Cute-Software-825245600984214/
      -Twitter: https://twitter.com/0_Blue_Apple_0
      -YouTube: https://www.youtube.com/channel/UCSheG2hkyuo3CF6PI-Ucgpg
      -Web site: https://themixios.wixsite.com/cutesoftware
      And that's all, don't forget to give your opinion and report the bugs, have fun !
  • Popular Now