Jump to content

Map size


OPEJ
 Share

Recommended Posts

Hi , I m  a new guy of this game and I am studying how to mod this game. This is my first question below:

After I browse the editor, the map size are fixed to several part like "Tiny" "Large" "Giant" etc.

If I want to custom a map size is larger than "Giant".  Is that possible to edit?how?

  • Like 1
Link to comment
Share on other sites

37 minutes ago, OPEJ said:

Hi , I m  a new guy of this game and I am studying how to mod this game. This is my first question below:

After I browse the editor, the map size are fixed to several part like "Tiny" "Large" "Giant" etc.

If I want to custom a map size is larger than "Giant".  Is that possible to edit?how?

yes it is possible to edit  in rmgen look at 

 

  • Like 1
Link to comment
Share on other sites

You need to be careful when choosing sizes that are excessively high.

A map with double the dimensions of giant size would have 1024 tiles a side. Map area would be 1048576 tiles! Considering texture and height values need to be stored for each tile, I wouldnt expect even initializing the map object to be quick.

And then you would need to actually manipulate the grid and place objects.

This is actually a kinda extreme example, but I hope you get the point.

TLDR: Expect to get bored during mapgen. Unless 0AD crashes ofcourse.

==Edit==

I have been wondering whether changing the 2D arrays in rmgen to typed 1D arrays would lead to a significant performance improvement.

However, array[x][y] is more readable than array[y * size + x]. So, theres that as well.

Edited by Guest
Link to comment
Share on other sites

@(-_-) You'r right . After I test my custom size of map. It took me a loooong time during the mapgen . And sometimes will get a fail gen(I am still figuring what's wrong).

Anyway ,it is hard to build a super large map...   But I hope it can be simple in the future. Because I am planning to make a ww1 mod, with bigger weapon,railwaygun warship...etc.

Btw,do u know which hardware be used during mapgen??  I found that only few core of cpu deal with that...

  • Like 1
Link to comment
Share on other sites

2 hours ago, OPEJ said:

And sometimes will get a fail gen(I am still figuring what's wrong).

If its failing with errors, can you post those?

2 hours ago, OPEJ said:

Btw,do u know which hardware be used during mapgen??

Not sure. But I dont think utilising multi-cores for map generation have been implemented yet. @elexis might know more.

Link to comment
Share on other sites

Random map generation uses a single thread, so it can only utilize one core. Since the operations are sequential, only certain tasks could be outsourced to a secondary thread.

For instance when testing a Constraint against an area. If the area contains 1024 points, there could be 4 threads each testing the 256 points against the Constraint and then the map generation pauses until all 4 threads finished. Testing the constraint would have to be a read-only process, otherwise you get undeterministic behavior, race conditions and players would generate different maps ir they didn't segfault. We can probably achieve better results with smarter algorithms in random map generation and the later simulation.

Link to comment
Share on other sites

6 hours ago, (-_-) said:

If its failing with errors, can you post those?

852830296_failedgen.thumb.jpg.c6727e79f233410c37942327679a70fa.jpg

I have a noob question, where can I find the error message. They just appeared and gone...

3 hours ago, elexis said:

Random map generation uses a single thread, so it can only utilize one core. Since the operations are sequential, only certain tasks could be outsourced to a secondary thread.

For instance when testing a Constraint against an area. If the area contains 1024 points, there could be 4 threads each testing the 256 points against the Constraint and then the map generation pauses until all 4 threads finished. Testing the constraint would have to be a read-only process, otherwise you get undeterministic behavior, race conditions and players would generate different maps ir they didn't segfault. We can probably achieve better results with smarter algorithms in random map generation and the later simulation.

Thanks for explain.I really hope it can use mutiple core for mapgen. I don't want my others core just wait and see...

Link to comment
Share on other sites

Look at the error messages, it seems like it's a gamesettings bug (there are several in atlas). Even better than a logfile would be knowing how to reproduce the error.

31 minutes ago, OPEJ said:

Thanks for explain.I really hope it can use mutiple core for mapgen. I don't want my others core just wait and see... 

As mentioned they have to for large portions of the program and secondly doing better algorithms without implementing threading might still make the loading screen much faster without spending the additional time to implement threading. We want to spend our time efficiently too, so either the most effective measures first or the ones that are really quick to implement but still efficient.

Link to comment
Share on other sites

1 hour ago, (-_-) said:

Interestinglog.html file

https://trac.wildfiregames.com/wiki/GameDataPaths

Looks like either a too large size or too many entities judging from the out of memory error.

1 hour ago, elexis said:

Look at the error messages, it seems like it's a gamesettings bug (there are several in atlas). Even better than a logfile would be knowing how to reproduce the error.

Thanks,After I look over the script of map. I think I need more time to analyze script.

1 hour ago, elexis said:

As mentioned they have to for large portions of the program and secondly doing better algorithms without implementing threading might still make the loading screen much faster without spending the additional time to implement threading. We want to spend our time efficiently too, so either the most effective measures first or the ones that are really quick to implement but still efficient.

I will wait for that change:D

Link to comment
Share on other sites

1 hour ago, elexis said:

I mean which buttons did you press to get the error? Does the same error occur again when you press the same buttons? If we have the recipe to produce a bug, we can solve it most likely

oh...I just press "generate map". For now, only "Bahrain" would always get this error. I am still testing other maps.

Sorry for my bad English that misinterpret what you say...

Link to comment
Share on other sites

Oh I missed the "Out Of Memory". That can explain any sort of error that comes afterwards, especially if you set a maparea 4 times as large as the largest one officially supported.

It's possible to that alternative mapgeneration algorithms would not get Out-Of-Memory errors by being more efficient with memory (or even writing temporary files).

But even then it's questionable whether there won't be many other algorithms that get Out-Of-Memory issues during the game (especially the AI)

Link to comment
Share on other sites

42 minutes ago, elexis said:

Oh I missed the "Out Of Memory". That can explain any sort of error that comes afterwards, especially if you set a maparea 4 times as large as the largest one officially supported.

It's possible to that alternative mapgeneration algorithms would not get Out-Of-Memory errors by being more efficient with memory (or even writing temporary files).

But even then it's questionable whether there won't be many other algorithms that get Out-Of-Memory issues during the game (especially the AI)

I couldn't understand that why It "out of memory"? I'm sure my computer has enough RAM for it.

Link to comment
Share on other sites

The program might need a certain amount of consecutive free memory, but the memory might be fragmented. (For exampel if 8GB of 16GB are free, but it's 1MB free and 1MB allocated, one can't allocate one chunk of 2 MB).

One could find out at which place the OOM occurs in bahrain.js (by adding a warn("hello world")) after every statement and thus see which memory allocation fails (probably some array creation).

  • Like 1
Link to comment
Share on other sites

2 hours ago, elexis said:

The program might need a certain amount of consecutive free memory, but the memory might be fragmented. (For exampel if 8GB of 16GB are free, but it's 1MB free and 1MB allocated, one can't allocate one chunk of 2 MB).

One could find out at which place the OOM occurs in bahrain.js (by adding a warn("hello world")) after every statement and thus see which memory allocation fails (probably some array creation).

That mean I have to add a messagebox for each procedure in bahrain.js to find out the problem.Right?

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...