Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Questions about game programming  (Read 4430 times)

0 Members and 1 Guest are viewing this topic.

darekg11

  • Full Member
  • ***
  • Posts: 127
    • View Profile
Questions about game programming
« on: June 21, 2011, 05:19:27 pm »
Hi, summer is coming and I wanted to create at least a base for MMORPG 2D isometric game, I say base because I know I won't achieve anything big in 2 months.

My questions:
1)Character can wear varius types of weapons, how can I "stick" image of for example sword into hand of character?
2)What about weather effect like snow,rain,desert storm. Should I use particile system?
3)When shaders can be useful?
4)What about lights and shadows in SFML?
5)What about collision detection, should I only mark some terrains as "nonclickable" and other as "clickable"
6)How should I maintain multiple clients? I think spawning 100 threads for 100 clients is a bit of performance waist?
7)About optimization I think drawing only what is visible and sending data about things that are in player's field of view
8 )I need simply GUI system, which GUI made in SFML can You recommend and why? I need simple buttons, entryboxes for single lines of text and windows.

Thanks in advance for help


Thanks in advance.

krisando

  • Newbie
  • *
  • Posts: 20
    • View Profile
Questions about game programming
« Reply #1 on: June 23, 2011, 05:23:20 am »
I'm working on a similar project, quite a complex thing the design of a mmo.

By your questions you sound somewhat clueless about designing and programming a mmo. These aren't the sort of things you should be worrying about first. May be going about this the wrong way. =/

Quote
1)Character can wear various types of weapons, how can I "stick" image of for example sword into hand of character?

Paperdolling, drawing different parts of a person at certain positions. Eg, helmet, armour, legs, arms, weapon.

Quote
2)What about weather effect like snow,rain,desert storm. Should I use particle system?

What ever you find easiest, would be client sided.

Quote
3)When shaders can be useful?

When you need some effects and/or need processing power, they will be rendered with your hardware. Optimized for performance and quality.

Quote
4)What about lights and shadows in SFML?

Can do these using sources/emitters of light and obstacles. Suggest using a lighting engine or algorithm for use with cubes.

Quote
5)What about collision detection, should I only mark some terrains as "nonclickable" and other as "clickable"

Up to you, engine design, I'd say yes. But I do not see what relation clicking has to do with obstacles!?

Quote
6)How should I maintain multiple clients? I think spawning 100 threads for 100 clients is a bit of performance waist?

Client pools when your waiting on data, eg account server, receiving information. Connected clients can exist in an array, vector, list whatever suits you.

Quote
7)About optimization I think drawing only what is visible and sending data about things that are in player's field of view

I'm using tile synchronization, server sends whats in view, client shifts what has been sent and receives new portions of tile data in view.

Quote
8 )I need simply GUI system, which GUI made in SFML can You recommend and why? I need simple buttons, entryboxes for single lines of text and windows.

I'll be working on one as none of the ones made with SFML are suited or lacking for a games interface. They are generally poor to non existant functionality, creators have spent all their time recreating parts of win32 components, poor performance.

--

I think you better think of your design ground up, a small but core chunk of my engine has been design on over 35 pages of notepad. The design makes all the games content loaded externally. (Scripts, images, effects, map.. you name it) It's just an engine ;). Entirely server sided, very efficient, cross platform (thanks to SFML) and well structured.

It's taken a lot of consideration and attention, to design and refine all the various elements which make up a mmo, It's a tiresome and cumbersome task.

If you really are mad and want to go ahead with this, I suggest you design things from a engine up point of view, than a visual design point of view. Work out class designs, learn and research SFML, and other libraries functionality you will need and go from there.. If I were to loose my work, I wouldn't go back to making a mmo. It's such a full on project.

darekg11

  • Full Member
  • ***
  • Posts: 127
    • View Profile
Questions about game programming
« Reply #2 on: June 23, 2011, 10:45:36 am »
Thanks.

I think I will start with normal RPG, MMO may still be not in my reach. I guess I better start projecting. Thanks for time. If You have any hints please share them.

danman

  • Hero Member
  • *****
  • Posts: 1121
    • View Profile
    • Email
Questions about game programming
« Reply #3 on: June 23, 2011, 01:32:17 pm »
If you want to do a point&clic rpg, you need 3 things :
1) like you said, you have to ensure the player don't clic in a obstacle zone, but in addition, that the player will have the space to get there.

2) Moreover, obstacles can exists between the start point and the end point, you need to consider them and make a pathfinding query between these points.

3) Then, you have to ensure no obstacle will walk on the path your query had done, considering the size of your object.

I'm programming a library that does all that for my engine, and have finished the algorithm (but not the 3) ).
If you want, I can post them with diagrams, formulas and explanations.
Pointilleur professionnel

darekg11

  • Full Member
  • ***
  • Posts: 127
    • View Profile
Questions about game programming
« Reply #4 on: June 24, 2011, 10:35:57 am »
That would be nice if it is not a problem.

danman

  • Hero Member
  • *****
  • Posts: 1121
    • View Profile
    • Email
Questions about game programming
« Reply #5 on: June 24, 2011, 12:44:13 pm »
here 4 schemas : (i'm not a real artist ^^)
http://dl.dropbox.com/u/12423314/tuto%20pathfinding/1-initial.svg
http://dl.dropbox.com/u/12423314/tuto%20pathfinding/2-first%20path.svg
http://dl.dropbox.com/u/12423314/tuto%20pathfinding/3-path%20found.svg
http://dl.dropbox.com/u/12423314/tuto%20pathfinding/4-explanations.svg

this algorithm is a graphnode.

the first thing to do is to find a polygon on the line from the start point, to the end point. (your "first" node)
Next, you need to circle the obstacle, so you find the segment, you create 2 nodes for the 2 points of the segment, and you place a distance equal to the radius of your shape on the 3 positions ( before, next to, after, schema 4 ) you've got by :
Code: [Select]


px => the segment point
pi => intersection point
p1, p2, p3 => the solutions
r => shape radius


if px.x > pi.x AND px.y < pi.y THEN

#  \  -----  pi
#   \        / we need that path
#    \  px
#   extend the straight line (pi;px) and find the point p1, extend the adjacent straight line, and find the bisector between them
   
p1.x = px + r
p1.y = px.y + r

p2.x = px.x +r
p2.y = px.y +r

// used to test if next position is valid
p3.x = px.x - r
p3.x = px.y + r


// and you always test if p1/p2/p3 is in a polygon


I know it's very expensive and do better, but i'll optimise after. There's also a problem because the radius is larger and is on the segment (p1, p2) and (p2, p3), but it's nearly nothing.

I may have done english mistakes (i'm French), and mathematics mistakes (i'm 15) so check all that on the paper ;) .

In addition, i use for the polygon a powerful class of my engine, and use a context to save them and use them in a query.
Pointilleur professionnel

darekg11

  • Full Member
  • ***
  • Posts: 127
    • View Profile
Questions about game programming
« Reply #6 on: June 24, 2011, 03:42:15 pm »
Thanks, will be helpful.

darekg11

  • Full Member
  • ***
  • Posts: 127
    • View Profile
Questions about game programming
« Reply #7 on: June 25, 2011, 01:43:32 pm »
Sorrz for double post:
"Paperdolling, drawing different parts of a person at certain positions. Eg, helmet, armour, legs, arms, weapon. "

Could You write something more on it? So I basically draw every piece seperatly based on what characters wears, but how animate it later? Keep animations frames of every item and then just play?

danman

  • Hero Member
  • *****
  • Posts: 1121
    • View Profile
    • Email
Questions about game programming
« Reply #8 on: June 25, 2011, 02:16:48 pm »
You have to keep a shared  "shema position" of the items between your characters (or indicate were they are separatly), but keep in mind that it's a heavy feature, so a strong solution can be the solution to implement.
Pointilleur professionnel

darekg11

  • Full Member
  • ***
  • Posts: 127
    • View Profile
Questions about game programming
« Reply #9 on: June 25, 2011, 05:45:38 pm »
Just as I thought, any soultions how can it be resolved, any tutorials?