View previous topic - View next topic |
Author |
Message |
Gardon Scholar
Joined: 05 Feb 2006 Posts: 157
|
Posted: Sun Feb 05, 2006 6:57 pm Post subject: Desperate help |
[quote] |
|
Hi, my name is Jason and I've been programming for about a year and a half now (game programming seriously for about half a year).
My problem lies with complexity with games. I've currently only used SDL (no openGL or DirectX with it, just plain SDL), and made little simple games like tetris, pong, etc.
Well I'm looking to go higher, and was wondering what exactly I should do to take that step. Are there any suggestions you guys can give me as to what to do (ie. what books to read, what articles to read, what programs to work on)?
I've been looking on this site and looked at some sample games that are being currently worked on by the community here. The RPG's and stuff look wonderful, and I was just wondering if you could enlighten me on how you went about learning how to make things like that, and what I can do to progress to that point.
Thank you kindly,
Jason
|
|
Back to top |
|
|
Nephilim Mage
Joined: 20 Jun 2002 Posts: 414
|
Posted: Sun Feb 05, 2006 7:28 pm Post subject: |
[quote] |
|
You might want to be more specific about what problems you're looking to tackle. For instance, are you looking to learn more about tile engines? Collision detection? Pathfinding? RPG game structures? It's a little hard to make recommendations without a context.
If you're looking for stuff about high-level RPG game structure, I wrote a series of articles on how I architected my RPG Sacraments. If you go to my site, along the sidebar there are links to three articles discussing various aspects of development, plus a developer's log which may be of interest. It's aimed at Director programming, but most of the concepts are applicable to other environments. Mostly, they deal with how I set up the map renderer, cutscenes, and interface control, so they won't help you with more low-level graphics rendering and such, but that was the sort of stuff I couldn't find much of online, so I decided to write something in hopes it would help others looking to build their first RPG.
In addition to those articles, RPGDX does have an article archive with some interesting reads contributed by other members of this community - see the bottom of the sidebar on the main RPGDX page.
If you post some more specific areas you want to know more about, I'm sure people can point you to some great resources.
Good luck with your next project! _________________ Visit the Sacraments web site to play the game and read articles about its development.
|
|
Back to top |
|
|
Gardon Scholar
Joined: 05 Feb 2006 Posts: 157
|
Posted: Sun Feb 05, 2006 7:41 pm Post subject: |
[quote] |
|
Thanks, I'll check out those resources as soon as I'm done posting here.
My problem allys with no formal training. I realize that most people creating video games are college students (graduates or whatever) with experience in professional programming/design/etc.
I'm 17 years old and taught myself C++, however I lack the formal training so many get in college.
I guess I just don't know where to go. You mentioned tileEngines, collision detection, etc. I basically need to learn all of them. I mean I can figure some stuff out (like collision detection) but as far as implementing the best way/learning how to do it efficiently I don't have any experience.
Do you see where I'm coming from? I've just spent some time with tetris and stuff, so I haven't had to deal with tilemaps, scrolling background, layers of sprites, and animation. I need to learn just about everything.
What I was trying to ask was how did you guys start? I mean, how are you able to make an RPG with cool-lookin graphics and know what you're doing? How did you start, where did you start, and how did you begin learning the stuff?
Was it from books, articles, a mentor? Reading tricks isn't enough for me, because it doesn't teach me how to make my own game (and the fact that it was written in C rather than C++).
Programming role playing Games with DirectX 2nd Edition has tons of useful information, but never anything that could help me build my own game.
To this day I still don't know DirectX, and every tutorial I come accross is for some huge project that won't teach me the syntax I need to move on.
SDL seems easier than WIN API, and I don't know how to efficiently use windows to my liking in an application.
Do you see where I'm getting at? I need some guidance on how to actually learn how to make an RPG. DirectX, windows, whatever. I also have about 30 books, but they don't seem to help (please note I'm not stupid I just lack the experience needed to do something, and the direction to go in)
Thanks,
Jason Otto
|
|
Back to top |
|
|
Gardon Scholar
Joined: 05 Feb 2006 Posts: 157
|
Posted: Sun Feb 05, 2006 7:58 pm Post subject: |
[quote] |
|
If you're interested, here's some of my coding design I'm currently working with. It's pure SDL, wrapped up in Classes, and is a basis of how I code.
And I totally agree with what you said in your development log. The longer you leave a project the harder it is to come back to it.
Quite honestly, I can't remember how I coded that, nor decipher how it works at the moment.
Anyways, it's 2.6 megs, and it's in a .rar file, and is under 1000 lines of code (heavily organized)
~~~~~Standard 'wasd' keyset
~~~~~Can move diagonally
~~~~~Tap r to run/unrun (it toggles the run mode)
~~~~~Left Ctrl is attack, and that's about it, very standard
Here's the link:
Click here!
|
|
Back to top |
|
|
RuneLancer Mage
Joined: 17 Jun 2005 Posts: 441
|
Posted: Mon Feb 06, 2006 3:01 am Post subject: |
[quote] |
|
College teaches you a lot.
- An SCV rush is sad. Seriously. Don't do it or the other guys'll laugh at you. :D
- It's all about who has enough units to launch an attack first. Don't play too defensive!
- Zergs suck. I hate maintaining those stupid flying brain-things. :x Play Terran or Protoss.
- If you're going to snipe, make sure you're well hidden and don't stay in one spot or people will eventually find you after they look at where the shots are coming from.
- As a matter of fact, don't snipe. Someone'll just put stuff in your coffee to get back at you later that day. >"<
- Don't make the teacher's PC into a dedicated server. He'll notice in a few months.
- COBOL sucks.
That's about all I remember. The rest, I learned on my own, just like you're doing. So don't sweat the "formal training" college supposedly gives you, most of the time you'll just be plain bored and "learning" concepts you already know. :P
Start by learning C/C++/whatever you fancy. Learn it good. Damned good. You don't want that being an obstacle because you're going to be learning an API next, and choking on the concept of pointers when you're trying to learn how some fancy-shmancy DirectGL32 works is quite a setback.
Personally, I recommand sticking with SDL (mostly platform-independant) and then moving on to OpenGL (pretty powerful graphics API.)
Next, work out your needs. You seem like you want to make RPGs, so getting cutting-edge performance in your graphic engine isn't a necessity; a lot of what you'll be doing will be game logic. The rest is fairly generic. Start trying to draw stuff onscreen. Try to create and load a map from a text file. Add sprite into it. Make it so the sprites move about. Congrats, you're halfway done with the game's map engine. ;)
Forget about books. Books will teach you what does what. You'll forget about 2/3rds of it after you finish one. Hands-on experience will teach you how you can go wrong and force you to try to work out just what went wrong on your own (no fancy tutorials to compare your work to!) You'll realize and understand a lot of things as you experience them.
So... y'know... just start coding and do things the way you think they should be done. If you hit a snag, ask ahead if you can't solve the problem on your own. But by all means, just "do" it. Don't wait for a tutorial or book to hold your hand, just start writing code and see where you need to go from there. ;) _________________ Endless Saga
An OpenGL RPG in the making. Now with new hosting!
|
|
Back to top |
|
|
Gardon Scholar
Joined: 05 Feb 2006 Posts: 157
|
Posted: Mon Feb 06, 2006 4:43 am Post subject: |
[quote] |
|
What about the different aspects of games?
My main problem now is sprites. I have a main character that can face and move in 8 different directions. Each direction has 12 animations, with 10 different actions in each direction.
Right there we're lookin at (8 x 10 x 12) 960 animations I have to load in memory at one time.
No imagine that with multiple enemies. i want my stuff in real time, so I want as little loading as possible, and if I have each enemy containing 960 animation frames (to load) times about 40 enemies... you can see where I'm hitting performance problems.
I'm also just using SDL, no other API, so there is no hardware acceleration. Granted that would help, but I'd still be overloaded with memory just from loading character bitmaps. Now factor in game logic, tilemaps... it adds up.
So my next question is about API's. I'd hate to not use DirectX, seeing as how I've spent literally hundreds on books that use it, but then again I want to program the best that I can.
I hate Win32, absolutely hate it, so I'm definitely sticking to SDL. I've heard OpenGl and SDL go hand in hand, so, like you said, I might want to give that a try.
It's just a shame I'm not using anything I bought, especially those gameinstitute.com courses.
What am I to do?
Jason
(by the way, let me add how helpful this community is. It's so much more friendly and un-bitchy like gamedev.net. God I can't go 2 minutes without fighting with someone on there)
|
|
Back to top |
|
|
Gardon Scholar
Joined: 05 Feb 2006 Posts: 157
|
Posted: Mon Feb 06, 2006 4:56 am Post subject: |
[quote] |
|
Maybe this will help:
I'm a "do-it" learner. What I mean by that is I learn things faster than most people, but in return, I can't really think and do things for myself on the first try (heh, maybe like and adaptible robot. You can't expect it to learn something without 1) knowing how to learn it and 2) showing it how to do it).
That's why I'm stuck. I've never made an RPG before, yet, I crave to do so very much.
I could very easily learn some basic parts (like tilemaps and enemy positioning) with 1 simple lesson, but without that lesson I'm utterly lost.
It just sucks because I pick up things rather fast but I get frustrated when I can't do something without having someone else show me.
Jason
|
|
Back to top |
|
|
Ninkazu Demon Hunter
Joined: 08 Aug 2002 Posts: 945 Location: Location:
|
Posted: Mon Feb 06, 2006 5:23 am Post subject: |
[quote] |
|
Basically for a tile scroller you have to have 1 or 2 things. If you want to have a camera (your character moves from the center of the screen if the camera hits the edge of the map) then you need that second thing.
OK so first. The map. I usually like to go with a 1D array since it has a faster access time, so I'm going to use that.
Some pseudocode:
Code: | mapWidth = 50;
mapHeight = 50;
map = new int[mapWidth * mapHeight];
//fill in the map array with tiles
playerCenterX = (SCREEN_WIDTH + playerWidth) / 2;
playerCenterY = (SCREEN_HEIGHT + playerHeight) / 2;
playerX = playerCenterX; //set starting position
playerY = playerCenterY;
//change player position with arrow keys
void mapDraw() {
CameraIntermediateX = (playerX - playerCenterX) / tileSize;
CameraIntermediateY = (playerY - playerCenterY) / tileSize;
PixelX = (playerY - playerCenterY) % tileSize;
PixelY = (playerY - playerCenterY) % tileSize;
CameraX = CameraIntermediateX;
CameraY = CameraIntermediateY;
if(CameraX < 0) { CameraX = 0; PixelX = 0; }
if(CameraY < 0) { CameraY = 0; PixelY = 0; }
mapArrayOffset = CameraY * mapWidth + CameraX;
yBoundary = SCREEN_HEIGHT / tileSize;
xBoundary = SCREEN_WIDTH / tileSize;
if(mapWidth < xBoundary) xBoundary = mapWidth -1;
if(mapHeight < yBoundary) yBoundary = mapHeight -1;
for(y = 0; y <= yBoundary; y++) {
dy = y * tileSize;
for(x = 0; x<= xBoundary; x++) {
dx = x * tileSize;
tile = map[mapArrayOffset + x];
drawTile(dx - PixelX, dy - PixelY, tile);
drawPlayer(CameraIntermediateX, CameraIntermediateY);
}
mapArrayOffset += mapWidth;
}
}
void drawPlayer(cx, cy) {
if(cx < 0) posX = playerX;
else if(cx >= mapWidth-1) posX = playerX - cx * tileSize;
else posX = playerCenterX;
if(cy < 0) posY = playerY;
else if(cy >= mapHeight-1) posY = playerY - cy * tileSize;
else posY = playerCenterY;
drawPlayerGraphic(posX, posY);
} |
I think you can see what to remove if you don't care about the camera. Also, if you're using tiles with sizes that are powers of two, I suggest using bitshifting on the multiplies and divides along with & (tileSize-1) instead of % tileSize on the perPixel scrolling variable.
I hope you can follow that code. The PixelX and PixelY are really the trick. That modulus shows just exactly how many pixels past the beginning of the tile the character is, so you can shift the tiles accordingly.
|
|
Back to top |
|
|
Nephilim Mage
Joined: 20 Jun 2002 Posts: 414
|
Posted: Mon Feb 06, 2006 5:28 am Post subject: |
[quote] |
|
Gardon wrote: | No imagine that with multiple enemies. i want my stuff in real time, so I want as little loading as possible, and if I have each enemy containing 960 animation frames (to load) times about 40 enemies... you can see where I'm hitting performance problems. |
Well, one thing you're probably running into is letting your desired game drive your programming design. When you get comfortable with your language and tools, that's fine, but when you're first starting out, it can cause trouble. I personally feel that it's a lot better to figure out what you can build and design your game around that.
For instance, practically no RPG that I can think of needs the graphics and animation for 40 different enemies in memory all at once. And 960 frames of animation are a helluva lot of frames for one character in your typical RPG. Try scaling that back, or see if there are efficiencies that can be made. For instance, depending on your art style, you may be able to "mirror" some of those graphics, which would cut the number of animation frames you need to store in half. (And as a side bonus, it cuts the amount of art assets you need to produce for each monster, which means you can either cut production time or increase the number of monsters available in the game.)
The singlemost important consideration when embarking on a game project is to be realistic about what you can accomplish. A less-ambitious game that you complete in two months is far more valuable than a more-ambitious game that would take you two years to complete, and which you eventually lose interest in and drop. Even if you end up finishing your two-years-in-the-making epic, spending two months on a smaller game up front will allow you to hone your skills and thus make a better two-year-epic.
So my advice would be to design a smaller, simpler RPG engine. Cut back on the feature list until you are confident that you can produce the game you're designing within a few months. You'll learn a lot, have something to show for your efforts, and you'll come out of it with a jumping-off point for your next, more ambitious project. (And if you do it right, you'll be able to reuse much of the code you write for the first project.)
I know that sounds like kind of a downer, but remember: RPG's are about telling a story, and you don't need the latest and greatest technology to do that - they've been making good RPG's since the early personal computer days. If you can make even a rudimentary RPG engine, you'll be able to tell a story, and people will enjoy your game.
Gardon wrote: | So my next question is about API's. I'd hate to not use DirectX, seeing as how I've spent literally hundreds on books that use it, but then again I want to program the best that I can. |
Well, SDL will let you publish for Mac and Linux, too, so I'm happy to hear you're sticking with cross-platform technologies. (Hint hint!) _________________ Visit the Sacraments web site to play the game and read articles about its development.
|
|
Back to top |
|
|
Gardon Scholar
Joined: 05 Feb 2006 Posts: 157
|
Posted: Mon Feb 06, 2006 5:42 am Post subject: |
[quote] |
|
Thanks nephilim and Ninkazu, you both were a big help.
Ok, so I got one more question (well two actually)
1) Tilemap editors. It seems there are so many out there, so should I make one? I've always learned my stuff by hard-coding things, and quite honestly I wouldn't know where to start on making a map editor. Heh, I think I just answered my question, but for future reference is it better to make one to design levels?
2) I've never even attempted to make an RPG before (and when I mean tempted I mean begin coding it), so I don't really know what's complex and what isn't, because I don't know any different.
It's like when I started learning how to program. C++ was my first and only language, so I didn't know how easy basic and phython were compared to my language of choice. It's just like I know of it, but not the different levels.
So going back to relating to RPG's, what should I do to keep it simple? To the best of my knowledge I won't worry about questing and different things like that, but more of a basic story line that can be completed by going through the game (ie. unlike bulder's gate where there are hundreds of sub-quests).
But what's a realistic goal? Do I just want to shoot for a basic world that my main character can move around in, with items to pick up and a couple enemies to battle and then be done with it? Just the rudiments of another game?
And what about hardware acceleration. Should I focus now on creating the RPG just in SDL which I am most comfortable with, or learn OpenGL and then attempt the game?
Thank you once again for your time,
Jason
|
|
Back to top |
|
|
RuneLancer Mage
Joined: 17 Jun 2005 Posts: 441
|
Posted: Mon Feb 06, 2006 5:59 am Post subject: |
[quote] |
|
If this is your first game, forget COMPLETELY about making it a big one. Seriously. You're learning: why make it something you know you're not ready to go through with yet? Start by, say, a single village, a single dungeon, one playable character, and a dozen enemies.
That's an unrealistic amount of animations for a sprite. But even so, consider left and right frames can be simulated simply by reversing the image, which cuts down the amount of images you need by 3/8ths. So: 600 frames. Assuming you're keeping it decently-sized (say, 32x48 like the sprite in my sig), that's 9 megs for a 256 color image. Modern cards can store plenty more than that, so it's no biggie. Still worried? Cut up your sprites into multiple images: have a "walk around" set of images containing just the movement animations and only load the other animations as needed (during events and the likes.)
Start by SDL, and start small. You can't be expected to go off after the boss right away just because you can beat the lowly slimes running around the dungeon. Once you're comfortable with the basics, and only then, start making plans for a more interesting project that appeals to you.
Don't worry about a map editor, just store your map in a text file and go from there. It doesn't have to be some complicated format, you're just experimenting. You'll have plenty of time to work on proper dev tools once you've learned what to put in a map and how to load/display it.
If you're worried about performance on your first game when you still don't even know what to expect, you're trying too hard. ;)
Edit: I took the liberty of checking out a few of your posts on GD.net, as I go there every once in a while. Don't think you'll be selling a game anytime soon, mate. ;) It'll take a lot of effort to get something commercial out there. But if you stick to it and put up with the basics for a while, who knows? :) _________________ Endless Saga
An OpenGL RPG in the making. Now with new hosting!
Last edited by RuneLancer on Mon Feb 06, 2006 6:09 am; edited 1 time in total
|
|
Back to top |
|
|
Gardon Scholar
Joined: 05 Feb 2006 Posts: 157
|
Posted: Mon Feb 06, 2006 6:09 am Post subject: |
[quote] |
|
RuneLancer wrote: |
If you're worried about performance on your first game when you still don't even know what to expect, you're trying too hard. ;) |
:) That's just me. (good thing? lol)
Anyways, you're right. I have to keep it simple.
Here's an image of what I'm currently working with
It's an isometric view, so I think I'm currently off on the programming aspect. I think my deal is that I suck at art so I can't draw anything anyway, and have to relate to free online sprites I find off google.
I mean, could I use these sprites for a top down view, like the sacraments game (or is that already isometric?)?
But you're right. I probably don't need the dying, been-hit, and tripping animations loaded all the time :)
I'll get started and keep you guys up to date with my progress.
I'm sure I'll be back asking questions, lol
Thanks again,
Jason
|
|
Back to top |
|
|
RuneLancer Mage
Joined: 17 Jun 2005 Posts: 441
|
|
Back to top |
|
|
Gardon Scholar
Joined: 05 Feb 2006 Posts: 157
|
Posted: Mon Feb 06, 2006 6:28 am Post subject: |
[quote] |
|
Ah, thank you (it's late :P)
Oh, and you guys are amazing! I guess I don't really know the computer at all. I thought for sure loading that attack bitmap to memory would take ages, but it didn't!
Granted, i had some numerous memory leaks, but still. I can load and unload the entire bitmap without losing speed (at least it wasn't noticeable).
I was almost positive I had to keep everything in memory because of a loss of speed. Guess I was wrong...
Jason
(Oh, so what do you think about the bitmap? Can I use that in a project, or is that too isometric?)
|
|
Back to top |
|
|
RuneLancer Mage
Joined: 17 Jun 2005 Posts: 441
|
Posted: Mon Feb 06, 2006 6:40 am Post subject: |
[quote] |
|
That's a huge bitmap. I would consider cutting down on frames if you want to keep things realistic. Try to avoid empty spaces too: if you have 20 blank pixels between two sprites and could fit them all in a smaller box, man, you're saving on massive space right there. Try to find the smallest size that fits all of your sprites and use that as a grid.
No matter what, do not load/unload images everytime you need them. For the occasional thing like preloading graphics before an event, it's fine. But if you load the walking frames one by one from disk as you need them, yes, it'll be dead slow. Instead, keep the entire walking animation in memory at onces (just an example, not sure if I got your last point right.) _________________ Endless Saga
An OpenGL RPG in the making. Now with new hosting!
|
|
Back to top |
|
|
|
Page 1 of 2 |
All times are GMT Goto page 1, 2 Next
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|