|
You last visited: Today at 12:53
Advertisement
Opinions on luckytime
Discussion on Opinions on luckytime within the CO2 Private Server forum part of the Conquer Online 2 category.
05/04/2014, 20:24
|
#1
|
elite*gold: 0
Join Date: Feb 2014
Posts: 397
Received Thanks: 205
|
Opinions on luckytime
So, I would like some opinions on how I should handle luckytime.
For example, I can either enumerate through players within a screen, and check for distance and check for llucky time. If a player is within range for luckytime, they start luckabsorb.
Now option B tht I have. When a player starts luckytime, its in a 7x7 grid. Now the tiles within that 7x7 grid, get an attribute declaring them luckytime tiles, a blessed tile if you will. When player is standing still on a blessed tile, they start gaining luckytime.
Which of these would be the smarter more efficient route. Or if you have another, better way, I would love to hear.
|
|
|
05/04/2014, 21:23
|
#2
|
elite*gold: 0
Join Date: Jul 2006
Posts: 2,216
Received Thanks: 794
|
Enumerate through players on the screen, it`s enough. Even if there will be 2k players on your screen only (which won`t), it still won`t be slow.
|
|
|
05/04/2014, 22:45
|
#3
|
elite*gold: 0
Join Date: Mar 2014
Posts: 219
Received Thanks: 27
|
I would agree with KraHen's opinion.
|
|
|
05/04/2014, 22:50
|
#4
|
elite*gold: 0
Join Date: Jan 2008
Posts: 1,445
Received Thanks: 1,176
|
KraHen is correct. Iterating through the broadcast set (screen) is enough. You will never have a lot of players on screen (without crashing the client), and iterating through hundreds of elements is really, but really fast.
The idea of the cell having the attribute is nice, but it's at least one byte per cell, for every map. At the end, you'll end with a lot of MB used only for that. (Could be merged with the altitude, and the access maybe.)
|
|
|
05/05/2014, 00:29
|
#5
|
elite*gold: 0
Join Date: Feb 2006
Posts: 726
Received Thanks: 271
|
What I did, was:
Every player tick (500ms), I would check to see if the player is casting LT.
If they are, iterate through their current screen and get every player within 3 tiles.
If they aren't second reborn, I would set their absorb timer to 3 seconds.
Then 3 seconds later, if the player is still there, start the luckabsorb.
Obviously a little more complicated than that, but you get the general idea.
|
|
|
05/05/2014, 05:07
|
#6
|
elite*gold: 12
Join Date: Jul 2011
Posts: 8,283
Received Thanks: 4,192
|
A better option might be to give observers in that smaller area lucky absorb until they move or teleport away, or until the caster cancels the spell (where it then checks the observers around the actor and rechecks for other casters).
|
|
|
05/05/2014, 11:49
|
#7
|
elite*gold: 0
Join Date: May 2011
Posts: 648
Received Thanks: 413
|
We did a simple loop for the screenobjects. The loop runs once every second, our player tick is at 100ms.
If they are in range we set IsPraying to true, inside the location x,y,map accessor we have it set to false if the value changes. There are a few more places were we invoke the IsPraying but you get the idea. Tileflags sound nice too, however since there is always a player casting luckytime you simply do a rangecheck on that player and player "B". For traps, flags would be a great way to handle them.
|
|
|
05/05/2014, 14:32
|
#8
|
elite*gold: 0
Join Date: Jul 2006
Posts: 2,216
Received Thanks: 794
|
What you`re talking about (flagging tiles or areas) is a commonly used concept in 3D games, only not with tiles, but with specific areas given by a KD-Tree, for just one instance, or a quadtree for polygon based 2D games (for collision). But in this context, it`s just unnecessary.
|
|
|
05/05/2014, 14:36
|
#9
|
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
|
Quote:
Originally Posted by KraHen
What you`re talking about (flagging tiles or areas) is a commonly used concept in 3D games, only not with tiles, but with specific areas given by a KD-Tree, for just one instance, or a quadtree for polygon based 2D games (for collision). But in this context, it`s just unnecessary.
|
Tile flags are a required addition to a Conquer server, there's an entire system based around it.
|
|
|
05/05/2014, 21:49
|
#10
|
elite*gold: 0
Join Date: Jul 2006
Posts: 2,216
Received Thanks: 794
|
Quote:
Originally Posted by Korvacs
Tile flags are a required addition to a Conquer server, there's an entire system based around it.
|
I guess you`re talking about the squamas/traps, yes, that could be expanded for this, but I still think it`s not worth it, if your screening system works as it should. Anyhow, performance wise there shouldn`t be any overhead doing one thing or the other (okay, maybe 1 microsecond - who cares, really), but I tend to follow that old agile rule - make it work asap (not talking about naive implementations of course).
|
|
|
05/06/2014, 01:41
|
#11
|
elite*gold: 0
Join Date: Feb 2014
Posts: 397
Received Thanks: 205
|
What issues would one find with the system I initially thought of?
|
|
|
05/06/2014, 02:17
|
#12
|
elite*gold: 12
Join Date: Jul 2011
Posts: 8,283
Received Thanks: 4,192
|
I revoke my previous statement. I thought about other options you may have, and I came to the same conclusion as Jack did. Every source should have some sort of bit flag enumeration type implemented for tiles. I know it's costly in C#, but it is entirely necessary to efficiently manage the game environment. If such a system is going to exist in your source, you should definitely take advantage of it. Checking the character's tile is much more efficient than checking multiple / entities in the screen.
|
|
|
05/06/2014, 02:39
|
#13
|
elite*gold: 0
Join Date: Feb 2014
Posts: 397
Received Thanks: 205
|
Quote:
Originally Posted by Spirited
I revoke my previous statement. I thought about other options you may have, and I came to the same conclusion as Jack did. Every source should have some sort of bit flag enumeration type implemented for tiles. I know it's costly in C#, but it is entirely necessary to efficiently manage the game environment. If such a system is going to exist in your source, you should definitely take advantage of it. Checking the character's tile is much more efficient than checking multiple / entities in the screen.
|
Exactly, I would think it is less work just to check your single location, instead of enumerating through multiple objects within a screen. Working the same as checking for invalid locations when moving, just checking if the tile has a blessed flag.
Edit:
What I'm probably gonna end up doing is this, base_X and base_Y being the players coordinates
Whenever someone casts lucky time,
Code:
int base_X = 10, base_Y = 10;
int lowerX= base_X - 3, lowerY= base_Y - 3;// Lowest possible coordinate value.
for (int x = lowerX; i < lowerX + 6; x++)//Enumerate through all possible X values.
{
for (int y = lowerY; j < lowerY + 6; y++)//Enumerating through all possible Y values.
{
map.SetBlessedTile(x, y);
}
}
|
|
|
05/06/2014, 10:28
|
#14
|
elite*gold: 0
Join Date: Jul 2006
Posts: 2,216
Received Thanks: 794
|
Quote:
Originally Posted by InsomniacPro
What issues would one find with the system I initially thought of?
|
Nothing at all. It was just my personal preference to go the other way around. Also bit operations aren`t costy at all, they`re probably the fastest operations you can do.
|
|
|
05/06/2014, 17:40
|
#15
|
elite*gold: 12
Join Date: Jul 2011
Posts: 8,283
Received Thanks: 4,192
|
Quote:
Originally Posted by KraHen
Nothing at all. It was just my personal preference to go the other way around. Also bit operations aren`t costy at all, they`re probably the fastest operations you can do.
|
You're correct, but comparisons are still much more costly than single operations, which is why it's a good idea to avoid overusing them. Don't take my word for it though, look into it yourself.
|
|
|
 |
|
Similar Threads
|
[LuckyTime]FireFlow
04/10/2010 - CO2 Weapon, Armor, Effects & Interface edits - 14 Replies
heya here a nice luckytime edit, press thanks if u like it^^
http://zoconquer.synthasite.com/resources/fireflo w1.JPG
download here
|
[help]luckytime
09/29/2009 - CO2 Private Server - 2 Replies
hi does anyone have a guide/release how to add the skill bless (luckytime) into a 5017 source like mine (Powerco Source) ty
|
luckytime
09/22/2009 - CO2 Private Server - 0 Replies
case 9876:
{
#region LuckyTime
Dictionary<int, int> Targets = new Dictionary<int, int>();
Targets.Add(CSocket.Client.ID, 0);
CSocket.Client.LuckyTiming = DateTime.Now;
ConquerPacket.ToLocal(ConquerPacket.MagicAttack(CS ocket.Client.ID, Spell.ID, 0, Targets, CSocket.Client.X, CSocket.Client.Y), CSocket.Client.X, CSocket.Client.Y,...
|
LuckyTime Bug!
01/27/2007 - Conquer Online 2 - 4 Replies
Hey you guys MAY you know the luckytime bug if the owner of luckytime casts it and 3 ppl sit on him (stackin) the first 2 on him will still get luckytime..
BUTTTTTT theres another bug .. you can cast luckytime in TG just use luckytime and press fastly sit (hotkey it) YOU can make lvl 80- fire taos stop attacking stakes^^ i did it many times buhaha enemy guilds ;D
(YOU CAN ONLY MAKE EM STOP IF THEY GOT LVL 2- FIRECIRCLE AND USIN IT)
enjoy~~
(i jus wanna share with u guys ok^^?)
|
All times are GMT +1. The time now is 12:54.
|
|