Sunday, April 21, 2013

Whats new, April 21st

Map Format
We now have the maps terrain mesh figured out partially.


VIDEO HERE: http://youtu.be/FX1b2OpoCFE
Managed to read in the WM file for map 001 Gungsong Fortress and export its Vertex's and Faces.

This is important to be able to know that we can work out the walkable areas on the map. Turns out they are everything you see there. Any gaps are non walkable. The formats basicaly a whole heap of points that make up triangles.

We have some people working on getting monster and npc spawns if you can help, please fill out the form in the previous post.

New AI Manager
Have been working on a new AI Manager which will allow us to script the monsters to do whatever we want. It is simple to use.

Example of some code:
var TestAICollection = new AIModule.AICollection();

TestAICollection.Make('AIOne',function(deltaTime) {
console.log('AI One executed, object has been alive for '+this.getAliveTime());

console.log('Simulating damaging monsters around me');
var that = this;
Objects.Search({nodeID: this.ID, type: TestAIObject, distance: 10}, function(distance,node) {
this.Damage(that.ID,20);
});

return { Meta: { Count: 0 }, AI: TestAICollection.Get('AITwo') };
},1000);

We can also keep track of attackers and how much damage they did, to either monster, character, npc.

Console log of the AI test:
AI One executed, object has been alive for 1000.0001939928201
Simulating damaging monsters around me
I have been damaged for 20 by 0 my health is now 80
AI One executed, object has been alive for 2005.0004060170625
Simulating damaging monsters around me
I have been damaged for 20 by 0 my health is now 60
AI One executed, object has been alive for 3010.000294819342
Simulating damaging monsters around me
I have been damaged for 20 by 0 my health is now 40
AI One executed, object has been alive for 4015.000405609906
Simulating damaging monsters around me
I have been damaged for 20 by 0 my health is now 20
AI One executed, object has been alive for 5020.000466362819
Simulating damaging monsters around me
I have been damaged for 20 by 0 my health is now 0
I am Dead
The objectID 0 did the most damage at 100
AI One executed, object has been alive for 6025.000845119293
Simulating damaging monsters around me
Respawning because dead in 2 sec
AI One executed, object has been alive for 7030.00036887993
Simulating damaging monsters around me
I have finished respawning come at me bro!
AI: Stand is not yet implemented.

New way to store query / access entitys in the Zone
As seen above by Objects.Search we can now store and query for objects in a much better way then we could previously. This enables better preformance on the server. *Previously it was lagging a lot*.

We hope to implement a Quadtree into our collection here is an example of one working:
http://www.mikechambers.com/blog/2011/03/21/javascript-quadtree-implementation/

Why would we use a Quadtree over an Octree? Well the games basicaly 2D if you look at it top down.
Monsters might agro a certian radius from their centerpoint. 3D Events that happen are sent to every character/client in a distance of 400 units from the origin point. The maps are pretty flat. By that I mean theres no parts that you can walk below and above on. Your always on one mesh as seen above.

For monster movement, we may look at implementing the A* search for path finding.
http://en.wikipedia.org/wiki/A*_search_algorithm we would have to pass it the walkable areas from the WM and it could find the quickest route to a player. This would allow monsters to solve mazes to get to their target, providing they are within distance to chase it still. We would have to tweek everything so its fair.

Improving packet reading
Packet reading is currently flawed, if multiple packets are received in one recive then the other ones after the first are discarded, this is wrong. I am recoding it to keep a cached buffer and to process packets as the data meets the correct size for a correct packet id. Along with this our packets can have documentation generated from them showing their data structure and code that they execute when received.

Node.js is quite nice.

Restruct seems to be slow however,  there are other librarys for binary<->json serialization and deseralization such as https://github.com/codeboost/binaryparser/ however I may just code my own on top of Node.js's buffer class since it has ReadUint and every other data type I need.

Good News
After all these core changes are put in place and working we can implement working monsters/fighting.

Whens the server open for testing?
Well not for a while still as we are not able to consider it playable or testable.

13 comments:

  1. With the amount of progress you've made already, I'm pretty sure it'll be up and running before the end of summer, we have faith in your coding! :D

    ReplyDelete
  2. will this reworking of coordinates stop insane kaisers spawning behind the wall in andown?

    ReplyDelete
  3. We will have full controll over the spawning, once we know what monsters go on what map we can make rectangular areas that they must stay inside. So they spawn inside a rectangle, get their Y position from the map if the map has no y position for the X Z then they cant spawn there and it will pick another spot etc.

    If a monster is chasing a player and they run behind a rock that you cant walk over/through then the monster should walk around the walk possible using A*.

    If a monster is chasing a player and the player runs too far away and the monster is within its bounding rectangle it will just stand around stupidly. If its outside then it will despawn and respawn back in its retangle somewhere.s

    ReplyDelete
  4. Personally, I dont like the part where if a monster goes out of its rectangle it respawns back inside of it part.... that just means a WHOLE lot of drama over boss killing because a diff faction will come in, and lure the boss till it respawns then POOF full hp again, think about Lord Of Azreals and other HIGH hp bosses..... that is just going to be a pain in the dic

    ReplyDelete
    Replies
    1. Boss like LOA could always be an exception allowed to roam the whole map?

      Delete
    2. how large is a bounding rectangle? personally, i don't think respawning mobs/bosses is a good idea, it could play havoc in T/S if the master can't drag mobs to the student and dragging bosses is pretty much essential in beoho and master maps (and colgu if you're adding that map)

      Delete
    3. Then just disable mob respawning in those maps?

      Delete
  5. This comment has been removed by the author.

    ReplyDelete
  6. This comment has been removed by the author.

    ReplyDelete
  7. i see i see, well tbh, its just not a great idea because pulling mobs to aoe kill them would be difficult then, unless u decide to place a few more mobs close enough to each other to pull the full 10 u can aoe at once (and yes its 10 in TS1 and not 5 tht u hit at the same time everytime u aoe)

    ReplyDelete
  8. Running into some issues with 3D Terrain and loadin gthem all at once, lol currently loading every maps terrain is using up the limit of node.js's memory.
    Rather than increase the memory I wanna find a more efficent way to load/store the data It needs XD :)

    http://udn.epicgames.com/Three/NavigationMeshReference.html

    http://algo.yonsei.ac.kr/international_CNF/FDTSalgo00Kang.pdf

    See square merge.
    Of course it seems to work best on bsp style maps not terrain height maps. Maybe we could do something similar for all flat areas. Eg town paths.
    http://forums.epicgames.com/threads/753806-NavMesh-with-terrain

    The other option is Path Nodes.

    Both of these things are mostly used for AI Navigation in like FPS games or MMORPG :)

    http://en.wikipedia.org/wiki/Shortest_path_problem

    http://www.opengl.org/discussion_boards/showthread.php/139058-Terrain-How-to-Get-Height-at-x-y-Still-Having-Probs!-Help-Plz

    http://www.isprs.org/proceedings/xxxviii/part2/Papers/33_Paper.pdf

    THIS ONE IS KOREAN!!! OMG
    http://kucg.korea.ac.kr/education/2004/csce458/paper/quadtree.pdf

    And how maps are stored in WOW?
    http://www.pxr.dk/wowdev/wiki/index.php?title=ADT/v18

    http://graphics.cs.ucdavis.edu/~staadt/download/TVCG-96.pdf


    For spawning monsters later with advanced AI's
    http://digestingduck.blogspot.co.nz/2012/02/choosing-random-location-on-navmesh.html

    http://www.youtube.com/watch?v=hQ2wpwse1fg

    Says buy but maybe you can find one thats free :P
    http://link.springer.com/chapter/10.1007%2F978-3-540-74607-2_5

    ReplyDelete
  9. is it will be free to any 1 from any country to play man?

    ReplyDelete