December\January Development Objectives

Development, Research, and Testing Updates.

Re: December\January Development Objectives

Postby lei2 » January 4th, 2016, 10:36 am

The new year already isnt that fresh anymore, maybe time for another ANH Paradise report.

Network and database - threaded up and rewritten to new engine - begin to settle, locking and else flaws are no longer in the priority fixme queue. In some future a review / cleanup might be suitable to clean up redundancies and weirds.

The zone rewrite also makes progress, with boost lots of strangeness is gone and the sync db makes fun to work with since things now happen where and when they are expected to happen. The dynamic casteritis also is mostly worked off, really weird encounters made here ... as if there isnt any getType, just let the cast decide everything. Most optimistic expectations, bare naked casts ... RTTI rulez.

By working through most every file of the zone - almost 1.5k casts had to be rewritten - some strange things showed up. The most prominent example I ran into prominent example of that might be preserved:

Code: Select all
                ObjectIDList::iterator defenderIt = mDefenders.begin();

                while(defenderIt != mDefenders.end()) {
                        // This may be optimized, but rigth now THIS code does the job.
                        this->makePeaceWithDefender(*defenderIt);
                        defenderIt = mDefenders.begin();
                        }

Dunno, must be some time since anyone killed the debris.

Eru again was right with the SI. It does not work as expected, does more than it should in some cases and not really what it is meant to in others. And thats not all. Instead of the grid, someone put the Containermanager in place to keep track of all things with an any to any reference register relation. Real weird stuff, also with a bit of comment like the above one. Not even a small slice of a chance that this might ever work seriously.

I really didnt expect such kind of findings. Dont know how long it will take to replace this with something that covers the nature of a gameraster a bit better. The grid is there, so it should be used then. It cries for an MCP to have a central place for this kind of stuff that will keep track of things and takes over CM and SI parts to get things onto the grid. Never thought I ever would do this ... but well ... it just happens ... right now.

So all in all maybe a glimpse of pale light at the end of the tunnel as this hopefully is the last basic subsystem that needs attention before the work on contents can get a go.

So happy new year and may the force be with you!

And - btw - its by now 10 years of ANH I guess.

greetz, lei
lei2
SWG:ANH Staff
 
Posts: 25
Joined: September 23rd, 2015, 1:11 pm
SWG Official Server: Farstar

Re: December\January Development Objectives

Postby Obi-Two » January 4th, 2016, 3:20 pm

Happy new YEAR!! Lei2, and all here at ANH, I hope everyone had a great time are are well rested, :D


lei2 wrote:Dunno, must be some time since anyone killed the debris.

Yes is been some time since the tutorial worked properly, I'm so glad your able to find stuff like this, A code clean up is in order, I'd love to help on that but I'd sadly need examples of what to take out and what to replace it with :( all being well we can get some support later on for this :D

I can not thank you enough for your efforts Lei2

who knows we maght have something big for the 10 year aniversary haha
Obi
Obi-Two

Quality Assurance
Star Wars Galaxies:A new hope
there is another...

Server by : Hostwind
Project : SWGANHServices/SWGANHJava
Obi-Two
SWG:ANH Staff
 
Posts: 246
Joined: January 3rd, 2009, 9:37 am
Location: Manchester, England
SWG Official Server: Ahazi

Re: December\January Development Objectives

Postby Eruptor » January 4th, 2016, 6:30 pm

Lei2, I assume your concerns regarding the code you quoted is the part where the iteration starts over in the loop? defenderIt = mDefenders.begin();
It's needed because the makePeaceWithDefender make changes to mDefenders and may invalidate the iterator.
It's a shitty solution/fix, hence the comment.

I don't understand the comment on the Debris, is that related to the quoted code or just a remark that your Tutorial isn't working?

I use two different versions of quad trees for both the "traditional" QT and for the SI.

The SI holds, generally speaking, all static or semi-static objects and they are represented by their shape (point or region so far. Circles can easily be supported). So yes, even the static objects inside buildings are kept in the SI (with world coordinates). The SI divide itself dynamically.

The QT holds, generally speaking, all moveable or otherwise interactive objects like players, creatures and some type of NPCs. And yes, the QT keeps track of moveable objects even when inside a building (also with world coordinates).
Objects in the QT are represented by points only. The QT has a predefined depth.

That said, it's up to the implementation what kind of objects you want to put into the SI and QT, they can be used with the "old style" handling of objects acting as pure replacements for the SpartialIndex and the QTree from before. My reason to dig into this was to get control of and understand the SI.

If interested, this is code that should be easy to port between our servers. The container is an unordered map and the key is of type uint64 so there would be minimal changes to do. And no, I have not used templates yet.
All calculations of "intersection" or "containment" on the objects shape are done by methods in the Anh_Math class. Not sure if you still have that around?

/Eru
Eruptor
 
Posts: 15
Joined: January 24th, 2009, 3:07 pm

Re: December\January Development Objectives

Postby lei2 » January 5th, 2016, 5:21 pm

Eruptor wrote:Lei2, I assume your concerns regarding the code you quoted is the part where the iteration starts over in the loop? defenderIt = mDefenders.begin();
It's needed because the makePeaceWithDefender make changes to mDefenders and may invalidate the iterator.
It's a shitty solution/fix, hence the comment.
I don't understand the comment on the Debris, is that related to the quoted code or just a remark that your Tutorial isn't working?

Hmm ... strange, indeed. The effect for me was hanging in an endless loop after the debris died. I simply assigned a list copy that is worked off then instead of working directly on mDefenders.

One problem with the Unofficial trunk is that different version files have been assembled to something that passes the compiler, so some things do not fit in that well. The Tutorial was one if that, so the xmas spare time fun has been to get it into operation and let things like debris and npcs spawn by lua again. But there I ran into the SI/CM issue tracing the reason why some of the persistents do spawn reliable while others fail to show up in client occasionally. Was a nice thing to do something else than rewriting the dynamics, even if it lead to new issues then.

Eruptor wrote:I use two different versions of quad trees for both the "traditional" QT and for the SI.

The SI holds, generally speaking, all static or semi-static objects and they are represented by their shape (point or region so far. Circles can easily be supported). So yes, even the static objects inside buildings are kept in the SI (with world coordinates). The SI divide itself dynamically.

The QT holds, generally speaking, all moveable or otherwise interactive objects like players, creatures and some type of NPCs. And yes, the QT keeps track of moveable objects even when inside a building (also with world coordinates).
Objects in the QT are represented by points only. The QT has a predefined depth.

That said, it's up to the implementation what kind of objects you want to put into the SI and QT, they can be used with the "old style" handling of objects acting as pure replacements for the SpartialIndex and the QTree from before. My reason to dig into this was to get control of and understand the SI.


QT ... huh ... not that Im really familiar with it, but isnt that more something that the client would use for
3d to 2d rendering and collision detection? Well, keepin track of things truly is common SI task.
The current SI as it is used in the Unofficial trunk Im working on ... with Zmap it more or less does not much more than with a given 2D world coordinate answering the questions what objects are here and which ones are players that need updates. And same for a couple of cells in viewrange as well.

With zmap/SI/CM I have two issues, one is the grid is 2D only, the second is that with CM there is no "single point of truth", which like in database is needed for any kind of data. Also there should be only one interface that is used for getting things onto and from the grid, which also currently is not the case. So CM is used some messages, Zmap/SI in others. Also I do not understand the lookup math.

A simple approach for the zmap 3D would be to drop the lookup, use a struct with a vec3 that is normalized to 40 and get that into a map with the objects references to represent a 3D virtual cell. This way only cells with content would be in the map and one could query it directly with the vec3 coordinates that are at hand. Or estimate the according "cells" in range. The only issue with this is performance, since with faster moving objects like vehicles that would change cell contents quickly or heavy loaded cells this will be a bottleneck as the viewrange with its 36 cells would need 100-200us query time on a slow box. Looks as if this was reason for the mKnown lists but their management effort kills all advantages. Maybe some kind of cache might help here, keeping a couple of lists that have been delivered lately to hand them out directly if the same cell/range is requested again.

Eruptor wrote:If interested, this is code that should be easy to port between our servers. The container is an unordered map and the key is of type uint64 so there would be minimal changes to do. And no, I have not used templates yet.
All calculations of "intersection" or "containment" on the objects shape are done by methods in the Anh_Math class. Not sure if you still have that around?

/Eru


The anh math isnt there any more, someone replaced it with glm which has a lot of capabilities but is most used for position, direction and distance. I would def be interested in how your SI/QT might fit in,
but I fear the unordered map will be a problem since its not supported by c++0x and it wont be easy to replace it using the "conventional" map. Together with the math ... guess we better delay that.
Templates ... they help in some cases but there is a price to pay. See forward declarations. No issue with the WM getById template, but thus not a swiss knife for each and every situation.

But guess before starting with the zmap I need to lookup for some more detail information about the client cells. Except the things in db and the messages which are only partly helpful.

Greetz, lei
lei2
SWG:ANH Staff
 
Posts: 25
Joined: September 23rd, 2015, 1:11 pm
SWG Official Server: Farstar

Previous

Return to Developer's Datapad

Who is online

Users browsing this forum: No registered users and 1 guest

cron