Jump to content
  • Advertisement
Sign in to follow this  
Apsi

Help with 2D graphics - Thousand Questions

This topic is 3666 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey guys! So, thing is im coding a small mmorpg project in DirectX. For now it's all text based, raw cpp. Yeah, all the events are in text but thats more for me to test how the db, classes and stuff are working. For now everything looks good, if I want to add an item I just have to instance its object and set its attributes, that goes the same for spells etc. I intend to make the game 2D. But I have a lil more experience in 3D creation. Since the 2D world is a bit blurry for me, I'd like to know how to create a top view camera so I can 'move' the screen forward once the character hits the edges. Also I was wondering how to render the tile-based map. For now I have some code that allows me to render as many sprites as I want and move them. Can I just render tile per tile?Should I make a map editor? Oh and another thing...My sprites keep covering each other. That means that when two of them collide, one starts covering the other one with its background (it's like real life, imagine getting 2 pictures with black background and crossing them in your field of view). I have already tried painting the background as pink (I think all the sprites are like that) but it didnt work out.Perhaps theres some code for that? Last question: If I am to create a mmorpg, should I instance an object with whole new attributes for every new player?Or one global object would do?Or perhaps I have to instance an object for every player in the server app and only one object for the client? Haha forgive me for my thousand question thread but I simply have too many questions. I'm already quite happy I got them all in the paper. Thanks in advance! Marcelo

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Since the 2D world is a bit blurry for me, I'd like to know how to create a top view camera so I can 'move' the screen forward once the character hits the edges.


This article: Smooth scrolling a tile map was extremely helpful when I wrote a tile based game.

Quote:
For now I have some code that allows me to render as many sprites as I want and move them.


That's good, but just because you CAN doesn't mean that you SHOULD. Try to only draw what is needed by using QuadTrees and other tests to prevent drawing stuff that is not on screen.

Quote:
Can I just render tile per tile?


I prefer to draw each layer of tiles in a single pass and only draw the number of tiles required to fill up the current screen (but make sure to leave a border so you can use smooth scrolling!). Although you could use other methods to reduce drawing.

Quote:
Should I make a map editor?


If your project requires it, although I would use something like: Mappy

Quote:
Oh and another thing...My sprites keep covering each other. That means that when two of them collide, one starts covering the other one with its background (it's like real life, imagine getting 2 pictures with black background and crossing them in your field of view). I have already tried painting the background as pink (I think all the sprites are like that) but it didnt work out.Perhaps theres some code for that?


Why are you not using Alpha Channels? The days of using programmer's pink are a bit obsolete IMO, alpha blending provides a much higher visual quality!

Quote:
Last question: If I am to create a mmorpg, should I instance an object with whole new attributes for every new player?Or one global object would do?Or perhaps I have to instance an object for every player in the server app and only one object for the client?


Networking is not my area of expertise so I can't really answer this question.

Quote:
Haha forgive me for my thousand question thread but I simply have too many questions.


It is no problem, we are here to help. I like seeing people ask specific questions.


Now that I have answered your questions, let me provide you with some advice. You do not sound ready to create an MMORPG game of any scale. A lot of your questions are basic questions that you should have encountered making smaller games. For example scrolling, map editors, and sprite transparency are all issues that occur very commonly and are not specific to MMORPG games at all.

It does not seem like you have a lot of game creation experience and I strongly recommend that you attempt a smaller and more manageable project before attempting to create an MMORPG.

Why not create a single player RPG game? That should teach you things like scrolling, entity management, quest management, complex data structures, loading/saving routines, AI, scripting, and music/sound systems.

Or if that provided to be too much you could create a 2d platformer game. That would teach you about state (screen) management, sprite handling, AI, collision detection, and loading levels.

I know it seems like you have limited time to get your dream MMORPG game done... it might seem like you have to make progress as RAPIDLY as possible or you are getting nowhere and will never see your dream come true. However you must realize that the road to becoming a game developer is a road that stretches on for YEARS. It will take you many many years in order to get decent at making games and even then you will still have a great deal to learn! Know your limitations and don't bite off more then you can chew.

I hope this has been of some assistance.

Good luck!

Share this post


Link to post
Share on other sites
Hey there fellow!
thanks for the replies, they are very interesting!
well you see, I do have some game programming experience but only in very small projects. By working in those small projects I learnt how to bypass my incapacities by taking different paths ,sometimes not the best ones.( for instance, I'm not going to require collision detection in my game at its graphical phase and still the battle system will be pretty fancy!).Anyway as you said just now I'm not really going to create an mmorpg out of the blue. First it will be a single player rpg, and then in the future, after studying more on online programming I might consider making it online. But fact is that I'm designing this game right now as a text based rpg, just to make sure the data flow works correctly. It's already a ton of work haha! So I'm just taking a step at a time, first text based, then after learning how to properly manage the graphics it could be a graphical rpg, then after expanding it a lot perhaps make it mmorpg ( of course that's still my main goal )
Well thanks for the replies and I will look through the info you just gave me, it's very valuable!

Share this post


Link to post
Share on other sites
Im sorry if this comes out overly harsh or something, but Im really just trying to make your stay here (may it be long and fruitful) at gamedev as smooth as possible. Thusly, until your RPG is going to be MMO, its generally best to not mention those 3 letter, otherwise you're likely to get the same redirection of advice.

If its going to start single player, Ive got one of those, you make it. As you come to an obsticle, google it, and if you're still stuck, ask here, and usually an answer gets formulated.

And now for my bit of any MMO advice, if you're starting single player, dont even think about how to make something work for anything more than single player. It makes a fairly simple system amazingly complex.

Share this post


Link to post
Share on other sites
Shadow and BreathOfLife both make good points, if this is a first game project it's best to aim smaller, having said that, going with a small multiplayer game shouldn't be too bad. shadowisadog's points about learning the basics in single player context first make good sense too, there's really no point dealing with 100 different issues when they are all stacked on one another, simply take one step at a time. And as breathoflife pointed out, skip the MMO letters, people tend to get irked just seeing that.

More directly to your questions, shadowisadog gave the best answers i can think of to most of them, as far as the networking side, i've only just started implementing it myself, but the implementation would depend on the object, really the object should probably only be implemented once on the server side, but can multiple users query it concurrently, or is it first in first served? If the object can only be used by one player at a time, you'll want to lock it and make sure that other users receive a message to tell them that it is currently locked for use, if multiple people can use it concurrently, you may need to separate the data per user.

For my own implementation, i have a communication thread per player that just waits for input and then processes it, then sends the output to the player, everything is calculated server side, so when a player wants to do something, they basically say "this is what i want to do, can i do it" the server then checks the command and returns whatever they need. Since my system is turn based it usage of an object wouldn't work the same in my system as yours as it is not possible for multiple users to operate on the same object concurrently. Keep in mind that when you're going multiplayer, you can never trust the users, you should treat everything the user sends you as suspicious and make the appropriate checks. For example, with an RPG, the player might send a command to attack a specific object, if the player has hacked their file and modified the packets, they could attack anything, anywhere, unless the server checks to see if it is possible.

RPGs are complex games, especially if you're aiming for real time, so it is always better to learn piece by piece.

If you're very new to game programming i found the best way to learn was to do the following.

1. Make a "connect 4" game that is hot seat 2 player, that is, turns are handled on the same computer. This gives you an insight into the basic graphics, a very basic game engine and working with completion conditions.
This might take you an hour or so if you're already familiar c++ and directx.

2. Implement an AI, this will give you an idea of different types of AI algorithms you would need. for connect 4, it's going to be checking possible moves, whether to block the opponent, where the AI can win, and how to place pieces to maximise winning possibilities.
When you step up to RPG, you'll be using pathfinding algorithms, behaviors etc.
AI is my weakest point, i have another team member working on AI with the project i'm currently working on so i can't really say how long this is likely to take. I used just a bunch of if statements and gave different moves different priorities, for example, if the AI could win, just do that, otherwise if the other player could win, block that, otherwise, move the the best spot for giving the AI win locations.

3. Move the game engine into a central server that accepts clients. At this point you need to look into the different network architectures you could use, in this case TCP would be your best bet. Then the server needs to communicate with each of the clients as far as what move they make, updating the data with each client and accepting new input, it also needs to raise the end of game event on both sides.
Moving this really doesn't take long, one you look into the networking commands (specifically in this case TCPListener, TCPClient and networkstream check msdn on these, the info is good) you're not looking at a huge amount of time to get it fixed up.

These are some of the best things i have run through myself for learning different aspects of game development, but you will find many other fantastic resouces through the forums here. Check out the stickies in the different forums, they often have links to tutorials and FAQs that have loads of helpful information.

I hope this helps you out and good luck!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!