questions about MORPG
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.
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.
ok, it's not a reader, but how can i get the datas from mysql server to c++?
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
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
-
- Posts: 368
- Joined: Tue Aug 21, 2007 1:43 am
- Location: The Middle of Nowhere
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.
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.
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
Dorth: okok, then i get it
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
Dorth: okok, then i get it
-
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
(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.)
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
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
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?
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?
-
- Posts: 368
- Joined: Tue Aug 21, 2007 1:43 am
- Location: The Middle of Nowhere
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.
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.
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?
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?
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...
So you should implement what "creature" could see others "creatures" and update in the way you want...