Forum index VCMI Project - Heroes 3: WoG recreated
Forum of the project aiming to recreate best turn-based strategy ever!

FAQFAQ  SearchSearch  MemberlistMemberlist  UsergroupsUsergroups  StatisticsStatistics
RegisterRegister  Log inLog in  AlbumAlbum  DownloadDownload

Previous topic :: Next topic
Opened by: Warmonger
2014-12-27, 14:29
Random map generator
Author Message
Macron1 

Joined: 02 Apr 2013
Posts: 576
Posted: 2016-08-09, 14:58   

Warmonger wrote:
Today I ran profiler and optimized some suprising parts of code. Generation time for Jebus XL+U was cut down by about 60%.
Further 40% could be improved by rewritting WeightedRule class from CMapEditManager. It uses a lot of expensive string copying and comparison, which should be replaced with enum or something.


Can water generation be expected in near future?
_________________
I'm not a member of VCMI developer group and my posts are not official. I'm just a fan.
 
     
Warmonger 
VCMI programmer


Age: 27
Joined: 07 Jun 2008
Posts: 1530
Location: Warsaw, Poland
Posted: 2016-08-09, 19:25   

Quote:
Can water generation be expected in near future?

Well, I don't have much time recently - better just polish existing game instead of adding new features.
_________________
Think twice if you really need to send me private message. Use public forum for general questions.
DJ Warmonger blog
beegee wrote:
Warmonger, you are the best!
 
 
     
SXX 

Age: 25
Joined: 04 Jul 2014
Posts: 291
Posted: 2016-08-11, 05:34   

I know very little about RMG code, but since you started to optimize it I gave it a try with Valgrind. Most interesting part of object creation already have your comment, but other weird thing I found is that TerrainViewPattern::WeightedRule::isStandardRule use quite a bit (5%+) of CPU time since on large map it's called like 40-50 million times.

Can something like STRONG_INLINE help a bit there?
 
     
AVS 

Joined: 25 Feb 2011
Posts: 545
Location: Russia
Posted: 2016-08-11, 06:10   

SXX wrote:
I know very little about RMG code, but since you started to optimize it I gave it a try with Valgrind. Most interesting part of object creation already have your comment, but other weird thing I found is that TerrainViewPattern::WeightedRule::isStandardRule use quite a bit (5%+) of CPU time since on large map it's called like 40-50 million times.

Can something like STRONG_INLINE help a bit there?


This function should be replaced with just one cashed field.
 
     
Warmonger 
VCMI programmer


Age: 27
Joined: 07 Jun 2008
Posts: 1530
Location: Warsaw, Poland
Posted: 2016-08-12, 21:42   

Implemented.
Reduced string usage and added caching for flipped patterns -> about 50% performance improvement.
_________________
Think twice if you really need to send me private message. Use public forum for general questions.
DJ Warmonger blog
beegee wrote:
Warmonger, you are the best!
 
 
     
SXX 

Age: 25
Joined: 04 Jul 2014
Posts: 291
Posted: 2016-08-30, 06:28   

One thing I wounder about with current git version of RMG.

Why every player-owned town have some impassable object right under the entry (where hero stay)?
 
     
Warmonger 
VCMI programmer


Age: 27
Joined: 07 Jun 2008
Posts: 1530
Location: Warsaw, Poland
Posted: 2016-08-30, 07:52   

I din't know really. So far my interest was only to ensure zone passability.
Maybe it's just optimal to route path diagonally.
_________________
Think twice if you really need to send me private message. Use public forum for general questions.
DJ Warmonger blog
beegee wrote:
Warmonger, you are the best!
 
 
     
AVS 

Joined: 25 Feb 2011
Posts: 545
Location: Russia
Posted: 2016-08-30, 08:53   

Warmonger wrote:
I din't know really. So far my interest was only to ensure zone passability.
Maybe it's just optimal to route path diagonally.


But road does not fit there. Roads can`t be diagonal.
 
     
Galaad 

Joined: 23 Feb 2014
Posts: 32
Posted: 2016-11-13, 13:37   

Hello,

I am a bit confused with random map generator, does it work? I don't have a rmg.json in my config, do I have to create one? How? Is there templates available and if so how to apply them?

Sorry for silly questions but I better be safe than sorry,

Thanks for response, cheers
 
     
AVS 

Joined: 25 Feb 2011
Posts: 545
Location: Russia
Posted: 2016-11-13, 14:05   

Galaad wrote:
Hello,

I am a bit confused with random map generator, does it work? I don't have a rmg.json in my config, do I have to create one? How? Is there templates available and if so how to apply them?

Sorry for silly questions but I better be safe than sorry,

Thanks for response, cheers


All available templates are in vcmi\defaultTemplates submod included in 0.99 release.
There in no single rmg.json anymore. Also there is a conversion tool (see http://wiki.vcmi.eu/index...list#Utilities) to convert rmg.txt temples to vcmi format.
 
     
Galaad 

Joined: 23 Feb 2014
Posts: 32
Posted: 2016-11-13, 14:50   

Thanks for your reply,

I don't have a defaultTemplate submod or subfolder :-? Is it available somewhere so I can grab it?
 
     
Warmonger 
VCMI programmer


Age: 27
Joined: 07 Jun 2008
Posts: 1530
Location: Warsaw, Poland
Posted: 2016-11-13, 16:30   

Galaad wrote:
Thanks for your reply,

I don't have a defaultTemplate submod or subfolder :-? Is it available somewhere so I can grab it?

Yes, it's in 0.99 package (Windows at least).
_________________
Think twice if you really need to send me private message. Use public forum for general questions.
DJ Warmonger blog
beegee wrote:
Warmonger, you are the best!
 
 
     
Galaad 

Joined: 23 Feb 2014
Posts: 32
Posted: 2016-11-13, 16:38   

Could anyone confirm it's also in the linux package? Because I don't have it, the find command does not return any entries.

Or if anyone could just upload it separately?
 
     
misiokles 

Joined: 12 Nov 2015
Posts: 155
Posted: 2016-11-13, 22:46   

Just download and unzip windows version and all wanted files you'll find under Mods directory.
 
     
Galaad 

Joined: 23 Feb 2014
Posts: 32
Posted: 2016-11-14, 00:42   

misiokles wrote:
Just download and unzip windows version and all wanted files you'll find under Mods directory.


Haha yeah indeed thanks
 
     
Display posts from previous:   
Reply to topic
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 vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
Add this topic to your bookmarks
Printable version

Jump to:  

Powered by phpBB modified by Przemo © 2003 phpBB Group
Template Chronicles modified by Nasedo modified by Tow.
© VCMI Team
Page generated in 0.07 second. SQL queries: 14