RPTools.net

Discussion and Support

Skip to content

It is currently Thu Jul 20, 2017 1:35 pm 




Forum rules


Posting now open to all registered forum users.



Reply to topic  [ 20 posts ]  Go to page Previous  1, 2

Previous topic | Next topic 

  Print view

Author Message
User avatar  Offline
Demigod
 
Joined: Sun Feb 25, 2007 11:53 am
Posts: 3630
Location: MD
 Post subject: Re: When switching Vision to Night, MT slows to a crawl.
PostPosted: Mon Jul 17, 2017 7:52 am 
jfrazierjr wrote:
At the time I first was playing with IFoW code, the dev team went into several days worth of discussion about the topic.

It wouldn't surprise me if there were some other legitimate or technical reasons that the community just wasn't privy to... but, on the surface, it's not optimal to go through the song and dance with new users that run into problems with it. It's a feature that requires a full grasp and understanding of vbl, light, vision, and FoW... and all the options available in the server settings. It's a lot to ask of new users trying to get the "full MT experience" before they understand what all the pitfalls/caveats are or each feature.

_________________
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Sep 11, 2007 6:31 pm
Posts: 5410
 Post subject: Re: When switching Vision to Night, MT slows to a crawl.
PostPosted: Tue Jul 18, 2017 9:33 am 
Full Bleed wrote:
jfrazierjr wrote:
At the time I first was playing with IFoW code, the dev team went into several days worth of discussion about the topic.

It wouldn't surprise me if there were some other legitimate or technical reasons that the community just wasn't privy to... but, on the surface, it's not optimal to go through the song and dance with new users that run into problems with it. It's a feature that requires a full grasp and understanding of vbl, light, vision, and FoW... and all the options available in the server settings. It's a lot to ask of new users trying to get the "full MT experience" before they understand what all the pitfalls/caveats are or each feature.


As I said, if the dev team agrees, I don't see a huge downside to it outside of retraining people who are used to that functionality. On the flip side, I know there has always been a want to re-write that code anyway from the ground up, but no one with deep design understanding of how geometry works in games has stepped up because it is an immense amount of time/effort to do so.

As for the "beginning" the dev team also did not really have a good idea how just how CRAZY(stupid?) people might use FoW(ie, hundreds of tokens, hundreds of maps, stupidly large outdoor scales, etc) and how IFoW would have an impact on performance with very large groups of exceptional map implementations. I know for me, the idea is to always have a new campaign file for each few areas/sessions (for the most part) AND I am local only, so the thought of people using MapTool as a complete campaign repository is alien to me. It was never designed to be that and users should not try to use Maptool to keep track of hundreds of maps in a single campaign file even WITHOUT FoW being utilized.

_________________
I save all my Campaign Files to DropBox. Not only can I access a campaign file from pretty much any OS that will run Maptool(Win,OSX, linux), but each file is versioned, so if something goes crazy wild, I can always roll back to a previous version of the same file.

Get your Dropbox 2GB via my referral link, and as a bonus, I get an extra 250 MB of space. Even if you don't don't use my link, I still enthusiastically recommend Dropbox..


Top
 Profile  
 
 Offline
Kobold
 
Joined: Mon Apr 10, 2017 4:50 am
Posts: 23
 Post subject: Re: When switching Vision to Night, MT slows to a crawl.
PostPosted: Wed Jul 19, 2017 4:29 am 
I have a couple of questions about the code of the FoW mainly because of my lack of understanding of Java. I can guess that there is a lot of math involved as there may be overlapping light sources (brightness), all the layers must be taken into account on what is visible, the VBL blocking light sources, and so on. I mainly code C++, so I looked at Java benchmarks of math. It seemed that older versions of Java were really slow at math, I mean very slow.

1) Is the code written for older versions of Java features, like 1.5 or 1.6?
2) Would updating the code using newest features of v1.8 help (it'd kill previous version support, though)?
3)Also, I found there are third party Java libraries, one called Jafama which does fastMath, not 100% accurate math, but that's not needed anyways, and one called JBLAS: Would using these help speed up the calculations?
( Jafama benchmarks are here: http://blog.element84.com/improving-jav ... afama.html and it seems all you need to do is change Math.function to fastMath.function so conversion shouldn't be too bad... I might even be able to do that and compile it to run bench marks. )

I'd help look at the code, but my understanding of Java is very basic, as in I started a course in it, so I can do 'Hello World'. From what I'm learning, Java code can be a bit slower than native binaries sometimes, but it shouldn't be as slow as what I, and others, experience, even if there are tons of sight tokens, light sources, and VBL. I have a really powerful Core i7 system, as well.

Cheers


Top
 Profile  
 
 Offline
Kobold
 
Joined: Mon Apr 10, 2017 4:50 am
Posts: 23
 Post subject: Re: When switching Vision to Night, MT slows to a crawl.
PostPosted: Wed Jul 19, 2017 2:47 pm 
I found someone on GitHub that updated the Jafama code, which was last updated in 2015. I downloaded the source files and added them to RPLib from Jamz's repo (https://github.com/JamzTheMan/maptool/tree/1.4.3.21) since I use the Nerps version of MT. I carefully vetted all finds of Math.function and changed them to FastMath.function. I was able to make a fat jar and copy that over to the existing jar. I couldn't build the whole thing as I get this error "** Reason: javax.imageio.IIOException: Can't read input file!", so it can't build the all in one wrapper thing, but at least I got the MapTools Fat Jar so I could run it.

I was able to add a lot of light sources and have 7 PCs with vision, some dark vision and some normal. It slowed down some, but it wasn't as bad as before. I found a different FastMath library that might be better, so I am going to try that out as well. Java has precise math, so it takes a long time to calculate, but the math for this doesn't need to be that accurate, because there will be no visual difference. This may be something to help improve the speed. Maybe the rewrite that someone mentioned earlier will help along with the FastMath.

I will make FastMath changes against the official master tomorrow instead of Jamz's and post the diff here for others to try. I don't know enough about Java to figure out all that is going on with Jamz's and the error.


Top
 Profile  
 
User avatar  Offline
Great Wyrm
 
Joined: Mon May 10, 2010 11:59 am
Posts: 1587
Location: Chicagoland
 Post subject: Re: When switching Vision to Night, MT slows to a crawl.
PostPosted: Wed Jul 19, 2017 7:38 pm 
@Dracwrym, All the FoW, VBL, Lighting isn't really driving by Math functions. It's all driven using Java's Area class: https://docs.oracle.com/javase/7/docs/a ... /Area.html

The Area's are then "intersected" and combined (using Area's build in methods) to get your various views. For IFoW, each token has it's own Area(s) stored for it (basically, there are some classes that extend area and such). So you would need to find a library that improved upon Java's native geometry Area class. (IIRC I did a quick look a while back but didn't find one)

Given that, the thought really is to rewrite using Ray Casting which should be faster than the Area class calculations (and give other benifits). For instance, implementing Box2DLights not only gives you faster results, you also get soft lighting and OpenGL support (so yes, video card caclulations vs straight CPU calculations). The problem is, it's a big undertaking to translate everything over to libdgx bodies, lights, world, etc) Particularly translating VBL "Area" to non-concave polygons via earclipping (I got it mostly working but some translation issus still pop up).

If you want to see this in effect, go to Help -> Box2D menu on my build to see a demo.

_________________
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
More information here: MapTool Nerps! Fork | TokenTool Nerps! Fork
Custom TokenTool (version 1.0b33): TokenTool.exe


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 20 posts ]  Go to page Previous  1, 2

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:

Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest (based on users active over the past 5 minutes)
Most users ever online was 243 on Sun Nov 04, 2012 6:14 am

Users browsing this forum: No registered users and 1 guest





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

Style based on Andreas08 by Andreas Viklund

Style by Elizabeth Shulman