questions about MORPG

Post your questions, suggestions and experiences regarding game design, integration of external libraries here. For irrEdit, irrXML and irrKlang, see the
ambiera forums
Dorth
Posts: 931
Joined: Sat May 26, 2007 11:03 pm

Post by Dorth »

massive regards to the size, not the genre.

and for the exp, use any formula you want, but it can be something like:

if (lvlmon + 10 < lvlpla && lvlmon - 10 > lvlpla)
{
return expmon / abs(lvlmon - lvlpla - 3);
}
else
{
return 1;
}

giving 1 xp if you are outside a 10 lvl bracket from the monster and more xp the closer you are to the monster lvl, with a bias to the lower lvls, ensuring a better chance for lower lvl players of catching up.
B@z
Posts: 876
Joined: Thu Jan 31, 2008 5:05 pm
Location: Hungary

Post by B@z »

okok, i give up xD

i think you wanted to use "||" not, "&&", right? :D

and in the else, not 1, but expmon, right? xD
but it's clear, thank you ^^b

i'll write again if i have a question.
B@z
Posts: 876
Joined: Thu Jan 31, 2008 5:05 pm
Location: Hungary

Post by B@z »

ah, and can you recommend me something for sql? xD
i mean a reader.
i found sqlite, but don't understand well ;;
it can't read my .sql file.
and, i think i don't need for a file reader, but a mySQL reader (from server)
maybe.. :P
Dorth
Posts: 931
Joined: Sat May 26, 2007 11:03 pm

Post by Dorth »

sqlite is an implementation of the SQL language, as is MySQL, as are many others. Each have their own variations. It is not a "reader".

Also, no, I meant exactly what I wrote.
B@z
Posts: 876
Joined: Thu Jan 31, 2008 5:05 pm
Location: Hungary

Post by B@z »

ok, it's not a reader, but how can i get the datas from mysql server to c++? :P

if (lvlmon + 10 < lvlpla && lvlmon - 10 > lvlpla)

then, it will never be.
there isn't any number like this.
lvlmon +10 < lvpla && lvlmon-10> lvlpla
impossible xD

edit: oh, i found the sql thing xD i can make queries, so it's cool, thx xD
Dark_Kilauea
Posts: 368
Joined: Tue Aug 21, 2007 1:43 am
Location: The Middle of Nowhere

Post by Dark_Kilauea »

You should only make sql queries when necessary. Things that should go in the database immediately are any major events (trading, buying from a merchant, gaining a level, etc). Things like enemy position are usually unimportant. Player positions should be saved to the database every so often (like 5 minutes or so).

Keep in mind that SQL queries are slow (relative to everything else) and will slow your server down if you make too many too quick. Latest benchmarks for MySQL allowed for 80,000 queries a second without being too terribly slow on the mysql server. You might never reach that number and you might. Plan ahead anyway :)

As for leveling, a lot of games use a exponential equation. So, for instance: BaseXPforLevel1 + someXP^level. You will have to experiment to see what value fits your style of game best. Does this game let you level quickly? Or will a player have to spend a long time to get to higher levels? That's up to you.
rogerborg wrote:Every time someone learns to use a debugger, an angel gets their wings.
Dorth
Posts: 931
Joined: Sat May 26, 2007 11:03 pm

Post by Dorth »

heh, good catch, the > and < should be reversed, my mistake, I had my attention on the &&
B@z
Posts: 876
Joined: Thu Jan 31, 2008 5:05 pm
Location: Hungary

Post by B@z »

hello

Dark_Kilauea:
well, i thought about a little, and what about that:

server start -> get all monsters info from sql (pos health, everything).
and from them, it doesn't do anything with the monster table.

and then, player start -> get player anything from sql
every 5 minutes, save the changes.

and then, when fighting with monsters and so on, it doesn't have to do anything with sql.

only just as you said, if i have to trade and so on.

if it's ok, then 80,000 queries... far away :D

Dorth: okok, then i get it :P
Dorth
Posts: 931
Joined: Sat May 26, 2007 11:03 pm

Post by Dorth »

unless you have few of them, it's pointless to load monsters if nobody's gonna encounter it in the next 3 days. Use your memory for something else. So just load as needed. The same holds true if no one can see a monster anymore, there's no point keeping it in memory.
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

(Partially) disagree, and here's why.

How much RAM does the server require at its peak load?

You don't know? Then how do you know that it won't start paging, and trash performance just when you need it most (i.e. when you've got the maximum number of players to be impressed or annoyed)?

For dedicated performance critical systems, I am a devotee of static allocation. Work out how much memory you could possibly require under a worst case scenario - maximum players, maximum mobiles - allocate it on startup, and load up everything.

If it fits without paging, great. If it doesn't, then it wouldn't have fitted when you needed it most, and you know that you either need more RAM or less content.

(Ignore this if you're planning a shared process server, but then it's hardly likely to be a "massive" game.)
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
B@z
Posts: 876
Joined: Thu Jan 31, 2008 5:05 pm
Location: Hungary

Post by B@z »

i agree.
i have to test a lot xD
but it's ok.

but i have a question.
in my AI, when the monster is close enough to the player, then it attacks.
but when the frame is at the half of the full attack animation it hits.
it worked OK for now, but now i have to let the server (just a console) control the AI, i can't get the frames... what should i do?
Dark_Kilauea
Posts: 368
Joined: Tue Aug 21, 2007 1:43 am
Location: The Middle of Nowhere

Post by Dark_Kilauea »

You should be able to time it. Wait a certain amount of time after the NPC begins it's attack animation and then apply the damage if it hits.

About the SQL database. Imagine your server crashes (due to a bug, power outage, whatever). Only what you have saved on the database will survive. So, you want to make sure that if the server does crash, when it comes up, it has enough information saved on it that players don't lose much. Players hate to had just gotten that super rare item, and then lose it to a server crash. :)
rogerborg wrote:Every time someone learns to use a debugger, an angel gets their wings.
B@z
Posts: 876
Joined: Thu Jan 31, 2008 5:05 pm
Location: Hungary

Post by B@z »

yeah i did that, thank you ^^b

and yeah.. xD but i think nobody will be mad at me, when the server is crash, and the monsters go back to the start point xD
so i think, i don't have to save monster positions at the database. just the init things. xD

and another question.
what should i do about positions? of course, i don't save it in database(the monsters), but how often should i send it to the client?
when it has changed?
or it has changed with a certain amout (for example, with 1)?
or just sending the destination point, and leave the other to the client?
pelonzudo
Posts: 20
Joined: Wed May 07, 2008 11:14 am

Post by pelonzudo »

I think you should implement something similar about collision... Mmmm you got the player sosition and the monsters's position, so when the monster enter in the player radius of visivility you send the info about that monster. Each time a monster changes it position/life/status send the info (only the needed) to the player's client.

So you should implement what "creature" could see others "creatures" and update in the way you want...
B@z
Posts: 876
Joined: Thu Jan 31, 2008 5:05 pm
Location: Hungary

Post by B@z »

it's clear, but when somebody can see the monster, should i send the position every time it has changed?
for example, it's just changin with 0,01, i send it?
isn't it better to send only if it had changed with 1? for the bandwidht
Post Reply