Intermediate-level game development

(originally posted in the Game Development forum, but after 3 days and 50+ views no one has responded so I’m posting it here)

I started out on game development thanks to LazyFoo’s tutorials. From there I’ve tried to program an RPG. Yes, I know it’s not the best type of game to start out on, but I didn’t want to create yet another Tetris clone. Plus, this way I’m more motivated to work on it, as it’s something I want to make.

I’ve run into problems, though. There is very, very little information on game development that isn’t for beginners or advanced developers. When it comes to creating an RPG, you find a lot of message board threads, but no answers at all.

What I currently have is a character walking around on a generated (read from a file) tiled map with two NPCs randomly walking around. Collision detection and handling has been implemented.

Things I struggle with:

  • A kind of event system for my game. I need to detect when the main character talks to a NPC, when it tries to enter a house, etc. Currently the first is just a block of code after all the collision detection and handling. I haven’t implemented anything else, not even a house.
  • A caterpillar system for a party of more than one person. I had this implemented using a linked list of the main character’s coordinates of each frame that the second character would start using once the distance between the two was more than 16 pixels. But the distance between the two once this behaviour had kicked in always varied, probably due to the variable frame rate.
  • I have no idea how to even start work on a battle system with menus, and the like. If I could at least know how you start doing this, that’d be helpful.

Just pointing me to a register/dispatch event model doesn’t cut it, as a game is something wildly different than some business application. Which is part of the reason why I struggle with all this in the first place.

That’s very ambitious. I’ve been working on an RPG engine for about 3 years now, and I’m just now getting it close to being finished. I’ve got most of those problems already solved, and I’d be happy to share some insights with you if you email me privately, but it’s all in Delphi.________________________________
From: benoit@gawab.com (Benoit Renard)
To: sdl at lists.libsdl.org
Sent: Wed, March 10, 2010 4:17:35 PM
Subject: [SDL] Intermediate-level game development

(originally posted in the Game Development forum, but after 3 days and 50+ views no one has responded so I’m posting it here)

I started out on game development thanks to LazyFoo’s tutorials. From there I’ve tried to program an RPG. Yes, I know it’s not the best type of game to start out on, but I didn’t want to create yet another Tetris clone. Plus, this way I’m more motivated to work on it, as it’s something I want to make.

I’ve run into problems, though. There is very, very little information on game development that isn’t for beginners or advanced developers. When it comes to creating an RPG, you find a lot of message board threads, but no answers at all.

What I currently have is a character walking around on a generated (read from a file) tiled map with two NPCs randomly walking around. Collision detection and handling has been implemented.

Things I struggle with:

  • A kind of event system for my game. I need to detect when the main character talks to a NPC, when it tries to enter a house, etc. Currently the first is just a block of code after all the collision detection and handling. I haven’t implemented anything else, not even a house.
  • A caterpillar system for a party of more than one person. I had this implemented using a linked list of the main character’s coordinates of each frame that the second character would start using once the distance between the two was more than 16 pixels. But the distance between the two once this behaviour had kicked in always varied, probably due to the variable frame rate.
  • I have no idea how to even start work on a battle system with menus, and the like. If I could at least know how you start doing this, that’d be helpful.

Just pointing me to a register/dispatch event model doesn’t cut it, as a game is something wildly different than some business application. Which is part of the reason why I struggle with all this in the first place.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

BenoitRen wrote:

  • A kind of event system for my game. I need to detect when the main
    character talks to a NPC, when it tries to enter a house, etc. Currently
    the first is just a block of code after all the collision detection and
    handling. I haven’t implemented anything else, not even a house.

I suggest some reading material: “Event-Based Programming,” by Ted Faison.
You’ll find some of the ideas are packaged in SDL. Most likely you will have to
start associating SDL_UserEventS with situations occuring in your game. Suppose,
for example, that a character walks from one square to the next. You would fire
an ActorMoved event and associate the old and new position with it. All parties
that are interested (“listening”) to this event would get notified of it and
respond (“handle”) the situation. Then start introducing new events whenever the
need arises. You can find more material on this under “Reactive,” or
"Actor-Based", or “Event-Based,” or “Event-Oriented” Programming.

Related material:

Gul Agha, ACTORS: A Model of Concurrent Computation in Distributed Systems
(Cambridge, MA: The MIT Press, 1986).

Patrick Th. Eugster, Pascal A. Felber, Rachid Guerraoui, and Anne-Marie
Kermarrec, ?The Many Faces of Publish/Subscribe,? ACM Computing Surveys, June 2003.

  • A caterpillar system for a party of more than one person. I had this
    implemented using a linked list of the main character’s coordinates of
    each frame that the second character would start using once the distance
    between the two was more than 16 pixels. But the distance between the
    two once this behaviour had kicked in always varied, probably due to the
    variable frame rate.

You will have to sync your events and frames somehow. In “Game Programming Gems
3,” the first article is named “Scheduling Game Events.” I strongly suggest that
you take a look at that. And Mike McShaffry’s “Game Coding Complete” should be
sitting on your shelf, too.

  • I have no idea how to even start work on a battle system with menus,
    and the like. If I could at least know how you start doing this, that’d
    be helpful.

Just take it one step at a time. There are many interacting components (and a
register/dispatch model will reduce coupling between them). The goal with the
easiest pay-off would be to implement a menu system. Have the main actor walk up
to an NPC, present a list of keywords, and let the user choose one. That alone
will have to make you think about interactions between the game core and the
renderer.

Just pointing me to a register/dispatch event model doesn’t cut it, as a
game is something wildly different than some business application. Which
is part of the reason why I struggle with all this in the first place.

Then you’re not open-minded enough. Event-oriented programming isn’t just
register/dispatch. (“It’s to reduce coupling, dummy.”)

And games are serious business.

CE

P.S.: Don’t be afraid to do research. The old-fashioned reading-books,
reading-papers, going-to-a-university-library, scouring-google kind of research.
All these things have been done before and there is no glory in painstakingly
re-discovering what somebody has done before you. It’ll help you come up with
new ideas and you won’t waste your time and avoid unnecessary frustration.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEAREKAAYFAkuYXSEACgkQwCnbyd7dCqQt/QCfQIMiCs5IBRdA9xQP7mThHaCG
uPAAoKwOX/luyX3Gudf/7TRZ1SpMKJBn
=1gTl
-----END PGP SIGNATURE-----

Well you don’t have to start completely fresh. Take a look at the
gemRB project. It also uses SDL. Just add multiplayer and it could
become a competitive game engine. Flat-world RPGs, still alive and
kicking.
Many RPG enthusiasts would be happy if you were to enhance this
engine. It even uses Python for game scripts. How cool is that?On Wed, Mar 10, 2010 at 10:01 PM, Chris Eineke wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

BenoitRen wrote:

  • A kind of event system for my game. I need to detect when the main
    character talks to a NPC, when it tries to enter a house, etc. Currently
    the first is just a block of code after all the collision detection and
    handling. I haven’t implemented anything else, not even a house.

I suggest some reading material: “Event-Based Programming,” by Ted Faison.
You’ll find some of the ideas are packaged in SDL. Most likely you will have to
start associating SDL_UserEventS with situations occuring in your game. Suppose,
for example, that a character walks from one square to the next. You would fire
an ActorMoved event and associate the old and new position with it. All parties
that are interested (“listening”) to this event would get notified of it and
respond (“handle”) the situation. Then start introducing new events whenever the
need arises. You can find more material on this under “Reactive,” or
"Actor-Based", or “Event-Based,” or “Event-Oriented” Programming.

Related material:

Gul Agha, ACTORS: A Model of Concurrent Computation in Distributed Systems
(Cambridge, MA: The MIT Press, 1986).

Patrick Th. Eugster, Pascal A. Felber, Rachid Guerraoui, and Anne-Marie
Kermarrec, ?The Many Faces of Publish/Subscribe,? ACM Computing Surveys, June 2003.

  • A caterpillar system for a party of more than one person. I had this
    implemented using a linked list of the main character’s coordinates of
    each frame that the second character would start using once the distance
    between the two was more than 16 pixels. But the distance between the
    two once this behaviour had kicked in always varied, probably due to the
    variable frame rate.

You will have to sync your events and frames somehow. In “Game Programming Gems
3,” the first article is named “Scheduling Game Events.” I strongly suggest that
you take a look at that. And Mike McShaffry’s “Game Coding Complete” should be
sitting on your shelf, too.

  • I have no idea how to even start work on a battle system with menus,
    and the like. If I could at least know how you start doing this, that’d
    be helpful.

Just take it one step at a time. There are many interacting components (and a
register/dispatch model will reduce coupling between them). The goal with the
easiest pay-off would be to implement a menu system. Have the main actor walk up
to an NPC, present a list of keywords, and let the user choose one. That alone
will have to make you think about interactions between the game core and the
renderer.

Just pointing me to a register/dispatch event model doesn’t cut it, as a
game is something wildly different than some business application. Which
is part of the reason why I struggle with all this in the first place.

Then you’re not open-minded enough. Event-oriented programming isn’t just
register/dispatch. (“It’s to reduce coupling, dummy.”)

And games are serious business.

CE

P.S.: Don’t be afraid to do research. The old-fashioned reading-books,
reading-papers, going-to-a-university-library, scouring-google kind of research.
All these things have been done before and there is no glory in painstakingly
re-discovering what somebody has done before you. It’ll help you come up with
new ideas and you won’t waste your time and avoid unnecessary frustration.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEAREKAAYFAkuYXSEACgkQwCnbyd7dCqQt/QCfQIMiCs5IBRdA9xQP7mThHaCG
uPAAoKwOX/luyX3Gudf/7TRZ1SpMKJBn
=1gTl
-----END PGP SIGNATURE-----


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Jeremiah wrote:

Well you don’t have to start completely fresh.

But that takes all the fun out of it. X)

CE

Mason Wheeler wrote:

I’ve been working on an RPG engine for about 3 years now, and I’m just now getting it close to being finished. I’ve got most of those problems already solved, and I’d be happy to share some insights with you if you email me privately, but it’s all in Delphi.

Thanks, will do this weekend when I have more time. :slight_smile:

Chris Eineke wrote:

And games are serious business.

Certainly! I didn’t mean that they weren’t. I meant that they aren’t typical business applications with point-and-click interface that react to specific user events.

P.S.: Don’t be afraid to do research. The old-fashioned reading-books, reading-papers, going-to-a-university-library, scouring-google kind of research.

Unfortunately, this kind of material generally isn’t available in libraries where I live. :frowning: As I implied in my opening message, I’ve searched Google plenty, but there is nothing. Well, except some French series of articles that doesn’t explain much and is really bare-bones (to the point that it’s in plain C and that character dialogue is outputted to stdout).

I’ve bought one book on game programming so far when it was cheap at a book event, Game Programming All-In-One. Unfortunately, that too was only beginner’s material (and it was plain C). The only thing I got out of it was to use Mappy for creating tile-based maps.

If only good books weren’t so expensive…

All these things have been done before and there is no glory in painstakingly re-discovering what somebody has done before you.

That’s exactly what I was thinking, and why I posted here. :slight_smile:

Jeremiah wrote:

Take a look at the gemRB project. It also uses SDL.

Thanks, I’ll take a look.

Here’s the thing: Lazy Foo’s tutorials are excellent, but they don’t
teach you game development*. They teach you how to use SDL, in a game
dev context. I’d go so far as to say LF deliberately leaves
architecture out of the picture to emphasize the point: as you
mentioned, those tuts won’t help much if you want to put together an
RPG/puzzle/platformer/. See if you can hack
something out on your own, then take a look at Game Programming Gems
or other readings on architecture.

*(with the exception of a few core principles like collision detection)

-BrendanOn Wed, Mar 10, 2010 at 8:17 PM, BenoitRen wrote:

(originally posted in the Game Development forum, but after 3 days and 50+
views no one has responded so I’m posting it here)

I started out on game development thanks to LazyFoo’s tutorials. From there
I’ve tried to program an RPG. Yes, I know it’s not the best type of game to
start out on, but I didn’t want to create yet another Tetris clone. Plus,
this way I’m more motivated to work on it, as it’s something I want to make.

I’ve run into problems, though. There is very, very little information on
game development that isn’t for beginners or advanced developers. When it
comes to creating an RPG, you find a lot of message board threads, but no
answers at all.

What I currently have is a character walking around on a generated (read
from a file) tiled map with two NPCs randomly walking around. Collision
detection and handling has been implemented.

Things I struggle with:

  • A kind of event system for my game. I need to detect when the main
    character talks to a NPC, when it tries to enter a house, etc. Currently the
    first is just a block of code after all the collision detection and
    handling. I haven’t implemented anything else, not even a house.
  • A caterpillar system for a party of more than one person. I had this
    implemented using a linked list of the main character’s coordinates of each
    frame that the second character would start using once the distance between
    the two was more than 16 pixels. But the distance between the two once this
    behaviour had kicked in always varied, probably due to the variable frame
    rate.
  • I have no idea how to even start work on a battle system with menus, and
    the like. If I could at least know how you start doing this, that’d be
    helpful.

Just pointing me to a register/dispatch event model doesn’t cut it, as a
game is something wildly different than some business application. Which is
part of the reason why I struggle with all this in the first place.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Brendan Luchen wrote:

See if you can hack something out on your own, then take a look at Game Programming Gems or other readings on architecture.

I have been trying to hack out something on my own for almost two years now, and I’m tired of trying to reinvent the wheel without any guidance at all.

To a certain kind of person, all these things seem very intuitive. Not
all types of design and/or programming challenges are appropriate for
all types of people. If you’re a good abstract thinker, there is
probably no other activity more rewarding than figuring all these
things out for yourself. Good maths skills help.On Wed, Mar 10, 2010 at 8:17 PM, BenoitRen wrote:

(originally posted in the Game Development forum, but after 3 days and 50+
views no one has responded so I’m posting it here)

I started out on game development thanks to LazyFoo’s tutorials. From there
I’ve tried to program an RPG. Yes, I know it’s not the best type of game to
start out on, but I didn’t want to create yet another Tetris clone. Plus,
this way I’m more motivated to work on it, as it’s something I want to make.

I’ve run into problems, though. There is very, very little information on
game development that isn’t for beginners or advanced developers. When it
comes to creating an RPG, you find a lot of message board threads, but no
answers at all.

What I currently have is a character walking around on a generated (read
from a file) tiled map with two NPCs randomly walking around. Collision
detection and handling has been implemented.

Things I struggle with:

  • A kind of event system for my game. I need to detect when the main
    character talks to a NPC, when it tries to enter a house, etc. Currently the
    first is just a block of code after all the collision detection and
    handling. I haven’t implemented anything else, not even a house.
  • A caterpillar system for a party of more than one person. I had this
    implemented using a linked list of the main character’s coordinates of each
    frame that the second character would start using once the distance between
    the two was more than 16 pixels. But the distance between the two once this
    behaviour had kicked in always varied, probably due to the variable frame
    rate.
  • I have no idea how to even start work on a battle system with menus, and
    the like. If I could at least know how you start doing this, that’d be
    helpful.

Just pointing me to a register/dispatch event model doesn’t cut it, as a
game is something wildly different than some business application. Which is
part of the reason why I struggle with all this in the first place.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


http://codebad.com/

Donny Viszneki wrote:

To a certain kind of person, all these things seem very intuitive. Not
all types of design and/or programming challenges are appropriate for
all types of people. If you’re a good abstract thinker, there is
probably no other activity more rewarding than figuring all these
things out for yourself. Good maths skills help.

Oh, great, a demotivator because I’m not part of the elite who can figure out game programming on their own.

Benoit, don’t put words into Donny’s mouth (keyboard?). It’s not about
elitism, it’s about (1) self-motivation, which is a must if you want to
succeed in game development, and (2) math/problem solving skills which
simply don’t come easily to some people. If coding doesn’t come naturally to
you, of course you can learn but it WILL be harder, and it’s just a fact of
life. You can’t expect folks on a mailing list to drop what they’re doing
and hold your hand through every step of the way. That’s what paid tutors
are for :wink:

I’m going to throw some links at you and then leave you in peace.
http://www.sloperama.com/advice/lesson15.htm
http://www.gamedev.net/reference/start_here/#5
http://annchienta.sourceforge.net/?page=annchienta

Oh. One more thing. People are a lot more helpful if you at least pretend to
appreciate their advice instead of complaining about "no guidance at all."
Just sayin’.

Hope this helps,
BrendanOn Wed, Mar 17, 2010 at 4:24 PM, BenoitRen wrote:

Donny Viszneki wrote:

To a certain kind of person, all these things seem very intuitive. Not
all types of design and/or programming challenges are appropriate for
all types of people. If you’re a good abstract thinker, there is
probably no other activity more rewarding than figuring all these
things out for yourself. Good maths skills help.

Oh, great, a demotivator because I’m not part of the elite who can figure
out game programming on their own.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

ugh, I’m very sorry, I didn’t mean it that way :frowning: you can probably figure
out a great deal more than you think you can, or perhaps your mind needs to
be freed from other distractions before you can focus :)On Wed, Mar 17, 2010 at 4:24 PM, BenoitRen wrote:

Donny Viszneki wrote:

To a certain kind of person, all these things seem very intuitive. Not
all types of design and/or programming challenges are appropriate for
all types of people. If you’re a good abstract thinker, there is
probably no other activity more rewarding than figuring all these
things out for yourself. Good maths skills help.

Oh, great, a demotivator because I’m not part of the elite who can figure
out game programming on their own.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


http://codebad.com/

To a certain kind of person, all these things seem very intuitive. Not
all types of design and/or programming challenges are appropriate for
all types of people. If you’re a good abstract thinker, there is
probably no other activity more rewarding than figuring all these
things out for yourself. Good maths skills help.

Le me add a bit to what Donny said. Since the 1940s (you can look it
up if you want to) many large, rich, and powerful organizations
including the US-DOD and IBM have spent a lot of time and effort to
come up with a way to identify people who are likely to be able to
become good programmers quickly. They identified three critical
talents.
(I’m, defining a talent as the rate at which an individual can learn a
skill. For example, the first time I ever tried to hit a duck on the
wind with a shot gun, I fired three shots and knocked down 2 birds.
That kind of shooting comes easily to me. I am (or was) what is called
a natural shot. OTOH, I never could hit a target :slight_smile: On the third
hand, I have earned a brown belt in a martial art. It has taken me
about three times longer than most people take to achieve that goal.
Clearly, I have little talent for martial arts. So, a talent measures
the rate at which you can acquire a skill, not the level of skill you
have acquired.) They are mathematics, mechanics, and language. People
who rapidly learn in those three areas seem to learn programming
quickly. Other people have other opinions. Edsger Dijkstra, on of the
grand old men and founders of computer science was of the opinion that
exceptional skill with your native language was the key indicator.

Ok, so those are talents that are held by people who are likely to
learn programing quickly. The other side of this is recent work done
on what makes a person an expert. The answer was pretty surprising. If
you spend part of every day for 10 years thinking about, learning
about, and working on a subject. You will be an expert. The same
number shows up in ancient stories about people who want to become
masters of a martial art…

Ten years. That is what it takes to become an expert in a subject. In
the bad old days that was about how long it took to become a
journeyman in a trade. Now days it is about how long it takes most
people to get a Ph.D. Ten years seems to be how long it takes to
become an expert. Modern psychology, modern and historical practice,
and even the mythology of martial arts all back up that 10 year
number.

You been frustrated for two years. Man, you are just at the point
where you can actually start learning this stuff. The books and links
that people have pointed you too are a good start. Please, keep at it.
I have found that in the long run my head is harder than a brick wall.
You just have to keep pounding your head against the wall until the
wall breaks. No, it is not pretty nor pleasant. But, it can be worth
it.

The other day in class I was helping a student debug a script for his
game project. Another student was watching. The script compiler was
giving us a totally useless error message so I started commenting out
code essentially doing a binary search to narrow in on the actual
cause of the error message. One of the students said something like,
“I’ve been studying C and C++ and programming for 3 years and I never
thought of doing that.” I looked at him and simply said, “I’ve been
studying programming for 38 years”. He got the point. It takes a while
to learn all this stuff.

I’ve added some other comments further down.

(originally posted in the Game Development forum, but after 3 days and 50+
views no one has responded so I’m posting it here)

I started out on game development thanks to LazyFoo’s tutorials. From there
I’ve tried to program an RPG. Yes, I know it’s not the best type of game to
start out on, but I didn’t want to create yet another Tetris clone. Plus,
this way I’m more motivated to work on it, as it’s something I want to make.

I’ve run into problems, though. There is very, very little information on
game development that isn’t for beginners or advanced developers. When it
comes to creating an RPG, you find a lot of message board threads, but no
answers at all.

There is a reason for that. I’ve taught game development class for
people who already had CS degrees and for people who are freshmen in
college. Most of real game programming takes a level of knowledge
roughly equivalent to a BS or even MS in computer science. But,
because of tools like UDK and even the old NWN toolset you can teach
people with almost no math or CS knowledge to develop some sort of
game. If you stick to basic things like Pong and Tetris you can teach
people with only a minimal (1 or 2 years) of education in programming
to write a game.

What I currently have is a character walking around on a generated (read
from a file) tiled map with two NPCs randomly walking around. Collision
detection and handling has been implemented.

So you are about 80% done. Not bad. Not bad at all.

Things I struggle with:

  • A kind of event system for my game. I need to detect when the main
    character talks to a NPC, when it tries to enter a house, etc. Currently the
    first is just a block of code after all the collision detection and
    handling. I haven’t implemented anything else, not even a house.
  • A caterpillar system for a party of more than one person. I had this
    implemented using a linked list of the main character’s coordinates of each
    frame that the second character would start using once the distance between
    the two was more than 16 pixels. But the distance between the two once this
    behaviour had kicked in always varied, probably due to the variable frame
    rate.

Yep, you need to do all this kind of stuff based on what I call
instantaneous distance, not actual locations on the screen. What you
see on the screen is just an approximation of the real game state. It
can’t be exact. You should just draw it and forget about it. It never
figures in to computing the next state of the game.

It really helps to learn calculus through at least integrals. Having
said that I’ll say that just taking calculus is not that helpful. You
have to understand the physical problems that lead to the invention of
calculus. Most importantly, you need to have a feel for the numeric
methods that are used to approximate the solutions of those physical
problems. It is very hard to find a class or a book that address the
math in a way that is meaningful to game developers.

Yeah, its a bitch.

  • I have no idea how to even start work on a battle system with menus, and
    the like. If I could at least know how you start doing this, that’d be
    helpful.

Just pointing me to a register/dispatch event model doesn’t cut it, as a
game is something wildly different than some business application. Which is
part of the reason why I struggle with all this in the first place.

Ok, you need to rethink that. People seem to have forgotten that
object oriented programming and event based programming were invented
to support discrete event simulation programming. Discrete event
simulation is the core of game programming. All the GUIs in the world
adopted the event model and OOP because it also happens to match the
problems of GUI programming. But, GUIs came along much later. The
first programming language to include objects was the designed for
doing discrete event simulation. Look up Simula. From wikipeida
"Simula 67 introduced objects[1]:2, 5.3, classes[1]:1.3.3, 2,
subclasses[1]:2.2.1, virtual methods[1]:2.2.3, coroutines[1]:9.2,
discrete event simulation[1]:14.2, and features garbage
collection[1]:9.1." Which matches my memory of SImula 67. (I learned
Simula around 73 or 74.)

So, OOP and event based programming were invented for discrete event
simulation. They were adopted into GUIs because they work well there
too. From there they were adopted into the Mac and Windows OSes and
into UNIX via X11. They moved into business applications because they
were the only way to write GUI programs and it turns out they are
pretty good for doing all sorts of transaction based applications.

So… Games are exactly a form of simulation and simulations are
where all this stuff came from.

BTW, to really understand all this you need to learn about finite
state machines.

I’m not trying to put you down or demotivate you. Donny wasn’t trying
to demotivate you either. Both of us in our own way are laying out the
world as we see. And, I can tell you that Donny and I do not always
see eye to eye. If it demotivates you to learn that it may take you
several more years to finish your first project, well, so be it.
Reality is a bitch.

On the other hand, I’ve outlined at least two years worth of studying
and book reading that will help you get a long way toward your goal.

Bob PendletonOn Tue, Mar 16, 2010 at 5:27 PM, Donny Viszneki <donny.viszneki at gmail.com> wrote:

On Wed, Mar 10, 2010 at 8:17 PM, BenoitRen wrote:


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


http://codebad.com/


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


±----------------------------------------------------------

Ten years. That is what it takes to become an expert in a subject.

profession, they are incompetent by definition. Reaching competence takes
about five years, more or less, depending on the profession. Becoming really
good in one’s profession takes twice, sometimes three times that long.

And that’s if you really work at it. As someone once said “Some people have 10
years experience, others have one year of experience ten times.”

It really helps to learn calculus through at least integrals.

FWIW I would say up through basic multivariable calculus. (You don’t need to
know how to use Green’s theorem, but you should know where to look it up and
be able to understand it.)

BTW, to really understand all this you need to learn about finite
state machines.

I would add that to do any “real” programming, one also needs a working
knowledge of finite automata.

Software engineering is applied math. If you can read Donald Knuth’s “The Art
of Computer Programming” without being totally bewildered, you’ve got a good
start. (A more accessible version is Robert Sedgewick’s “Algorithms in C” or
"Algorithms in C++".)

And, I can tell you that Donny and I do not always
see eye to eye.

Yep, me too. But this time he hit the nail on the head.

None of what I’ve said (or what Donny said) should be construed as
demotivating. Quite the contrary. We were all newbies at some point. I won’t
tell you about some of the silly things I did when I was a newbie. You can’t
become an expert until you’ve gone through the newbie and apprentice stages.

JeffOn Thursday 18 March 2010 14:36, Bob Pendleton wrote:

From my own experience, it appears that in general anytime one enters a new

You can’t become an expert until you’ve gone through the
newbie and apprentice stages.

Actually, the apprentice stage is where being the starry-eyed
enthisiastic kid among seasoned old hands is extremely helpful.

I was very lucky that both my profs at uni and the people at my first
workplace appreciated my enthusiasm. Most real professionals like
to dump their knowledge on you if you’re willing to listen. However,
you can’t be jumping around telling them that you don’t care about
that, you need a solution to this problem and you want it pronto.
That’s about the end of your learning carrier with them.

It is because they already know that to solve this problem you must
understand that seemingly unrelated issue. That’s what makes them
experts on their field. When they tell you to read book X you go and
read book X and come back asking them politely to explain you that thing
on page n that you can’t get through. They will explain. Then you get
inspired with your newly minted knowledge and come up with a Great New
Idea. You tell them and they tell you who came up with that idea 40
years ago and why would it not work. But you grew an inch in their eyes
and, in fact, you indeed did - you now know a lot more than you did
before. Rinse and repeat.

The internet and electronics made communication extremely fast and we
tend to think that everything is faster now. Well, learning isn’t. It
still takes years to learn what you need and many more years to
efficiently apply that knowledge on your field. The more you learn, the
more fields you discover that you know nothing about (and, due to
limited life expectancy, you never will). In a sense, the more you
learn the less you feel to know - when you are absolutely, positively
sure that you know nothing at all, then you are an expert :slight_smile:

Zoltan

It was demotivating to me because it implied that I should learn everything on my own, and that I would only be able to do so if I was the right type of programmer. Like I said, I don’t want to reinvent the wheel. I want to learn.

The last message about apprentices reflects how I feel pretty well. For HTML/CSS and Mozilla extensions, I had mentors. It was great, and I learned a lot. It sucks that I don’t have one for game programming.

I did not accuse anyone here of not providing guidance. I was referring to the period of almost two years when I tried to hack things out on my own.

Well, that sounds like an adoption request if I ever heard one. Anyone up
to it?

Jonny DOn Fri, Mar 19, 2010 at 12:05 PM, BenoitRen wrote:

It was demotivating to me because it implied that I should learn
everything on my own, and that I would only be able to do so if I was the
right type of programmer. Like I said, I don’t want to reinvent the wheel. I
want to learn.

The last message about apprentices reflects how I feel pretty well. For
HTML/CSS and Mozilla extensions, I had mentors. It was great, and I learned
a lot. It sucks that I don’t have one for game programming.

I did not accuse anyone here of not providing guidance. I was referring to
the period of almost two years when I tried to hack things out on my own.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

I’d be up for it. I’ve got the domain knowledge (building an RPG engine, specifically,) I’ve got a lot of the questions he’s asking about already worked out, and if my StackOverflow reputation is any indicator I’m pretty good at explaining programming concepts so that other people can understand them. The one tricky part is that most of my coding experience (and my entire RPG codebase) is in Delphi, which not too many people know these days.________________________________
From: grimfang4@gmail.com (Jonathan Dearborn)
To: sdl at lists.libsdl.org
Sent: Fri, March 19, 2010 10:40:25 AM
Subject: Re: [SDL] Intermediate-level game development

Well, that sounds like an adoption request if I ever heard one. Anyone up to it?

Jonny D

On Fri, Mar 19, 2010 at 12:05 PM, BenoitRen wrote:

It was demotivating to me because it implied that I should learn everything on my own, and that I would only be able to do so if I was the right type of programmer. Like I said, I don’t want to reinvent the wheel. I want to learn.

The last message about apprentices reflects how I feel pretty well. For HTML/CSS and Mozilla extensions, I had mentors. It was great, and I learned a lot. It sucks that I don’t have one for game programming.

I did not accuse anyone here of not providing guidance. I was referring to the period of almost two years when I tried to hack things out on my own.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Languages come and go but algorithms stay. I think that Delphi wouldn’t be
an issue.On Fri, Mar 19, 2010 at 6:55 PM, Mason Wheeler wrote:

I’d be up for it. I’ve got the domain knowledge (building an RPG engine,
specifically,) I’ve got a lot of the questions he’s asking about already
worked out, and if my StackOverflow reputation is any indicator I’m pretty
good at explaining programming concepts so that other people can understand
them. The one tricky part is that most of my coding experience (and my
entire RPG codebase) is in Delphi, which not too many people know these
days.


From: Jonathan Dearborn
To: sdl at lists.libsdl.org
Sent: Fri, March 19, 2010 10:40:25 AM
Subject: Re: [SDL] Intermediate-level game development

Well, that sounds like an adoption request if I ever heard one. Anyone up
to it?

Jonny D

On Fri, Mar 19, 2010 at 12:05 PM, BenoitRen wrote:

It was demotivating to me because it implied that I should learn
everything on my own, and that I would only be able to do so if I was the
right type of programmer. Like I said, I don’t want to reinvent the wheel. I
want to learn.

The last message about apprentices reflects how I feel pretty well. For
HTML/CSS and Mozilla extensions, I had mentors. It was great, and I learned
a lot. It sucks that I don’t have one for game programming.

I did not accuse anyone here of not providing guidance. I was referring to
the period of almost two years when I tried to hack things out on my own.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Benoit a lot of guys have said great stuff in this thread. Let me try
to tie it specifically to your questions.

(originally posted in the Game Development forum, but after 3 days and 50+
views no one has responded so I’m posting it here)

I’ve run into problems, though. There is very, very little information on
game development that isn’t for beginners or advanced developers. When it
comes to creating an RPG, you find a lot of message board threads, but no
answers at all.

What I currently have is a character walking around on a generated (read
from a file) tiled map with two NPCs randomly walking around. Collision
detection and handling has been implemented.

Things I struggle with:

  • A kind of event system for my game. I need to detect when the main
    character talks to a NPC, when it tries to enter a house, etc. Currently the
    first is just a block of code after all the collision detection and
    handling. I haven’t implemented anything else, not even a house.
  • A caterpillar system for a party of more than one person. I had this
    implemented using a linked list of the main character’s coordinates of each
    frame that the second character would start using once the distance between
    the two was more than 16 pixels. But the distance between the two once this
    behaviour had kicked in always varied, probably due to the variable frame
    rate.

This is where everyone is suggestion math and calculus. To make a NPC
match velocities with the player is very similar to robotics issues.
Look up PID control (proportional, integral, derivative)

  • I have no idea how to even start work on a battle system with menus, and
    the like. If I could at least know how you start doing this, that’d be
    helpful.

Menus and character conversations: This is all about finite state
machines etc. Each menu and submenu should be a node in the FSM, and
as you click on the options/responses you traverse the FSM. However,
note that an FSM is kind of a boring conversationalist :-). So let’s
add some twists. Of course, all of these twists can be theoretically
modeled as an immense FSM,but it easier not to do that in practice.

First, let’s carry some state around the FSM, like the NPCs emotional
state. And depending on that state different FSM nodes give different
responses. The NPCs emotional state changes depending on your actions
and prior questions (trivially if you solve a quest for the NPC they
get a lot happier towards you, for example).

Next, let’s modify the FSM as the conversation occurs so new
conversation options pop up as you talk and also so that you can refer
back to prior conversations without having to click thru the whole
conversation again.

So there you have it, a dynamic, stateful, finite state machine! :slight_smile:

Battles:

Get a pen and piece of paper and work something out using statistics.
Just like in the old Dungeons and Dragons days. For a really simple
one with lots of issues:

Assign every weapon an attack strength.
Every shield a defense strength.

Add character’s level and personal attributes to attack.
Ditto for defender.

Now you have 2 numbers. ATK and DEF (say 5 and 10). Divide ATK/DEF
and you get a fraction (50%). Make that how likely the attacker is to
hit the defender.

So just to give you something to chew on: Given the model above if
ATK > DEF then there is a >100% chance that the attacker will hit the
defender. Perhaps this isn’t realistic. There really ought to always
be SOME tiny chance the attacker will miss. How can this issue be
fixed?

Also chew over this: realistically certain items that the player
possesses inhibit an attack. For example plate mail is hard to move
around in. So actually you should assign every item an attack
strength and for armor that “strength” might be negative. And as we
all see in movies, helmets and shields make good clubs. So maybe they
should have an attack strength?

Once you add different attacks (blunt, edged, fire, acid, electricity,
missile) you realize that in fact, gaming IS a business application.
An RPC has got to have a big database in the back end that defines,
models, and assigns values to all this stuff. Its awfully nice to use
spreadsheets and/or SQL databases to capture all the relationships and
specific values.On Wed, Mar 10, 2010 at 7:17 PM, BenoitRen wrote: