Map Questions

Here you can post about your scenario's, mods, custom maps and YouTube channels!
User avatar
Bavaria Gichtenlord
Howdah
Donator 03
Posts: 1437
Joined: Nov 15, 2015

Re: Map Questions

Post by Gichtenlord »

did you instantiate the variable baseTerrain?
r]
User avatar
Romania mandosrex
Musketeer
Posts: 57
Joined: Mar 22, 2015

Re: Map Questions

Post by mandosrex »

Ok, ok, I somehow made it work, no idea how but... yeah.
Now I have a different problem, the map is really, really high! Like, the map has some rivers and those are at the normal altitude, but the rest of the map is really high up.

I tried fixing it by changing the map type from "grass" to "water" and by using "rmSetMapElevationParameters" but it didn't really work.
Help.


Edit: Oh, so... Apparently, if I put ", 0" after "baseTerrain" it works... It's not high anymore.
I have no idea what I'm doing. I will probably be back with more questions. :D
User avatar
United States of America Durokan
Retired Contributor
Posts: 970
Joined: Apr 12, 2015
ESO: Durokan

Re: Map Questions

Post by Durokan »

If you are editing a map that originated from my code, then what most likely was happening is you were declaring the mix before the section of text that writes textures on the map. I initialize the maps and then change the height later when I draw the large continent, so if that is removed then that's probably where you could get the issue.
Check out my Custom Map Workshop here!
http://eso-community.net/viewtopic.php?p=98718#top
User avatar
Romania mandosrex
Musketeer
Posts: 57
Joined: Mar 22, 2015

Re: Map Questions

Post by mandosrex »

I require assistance once again.

There's this awesome map made by Neuron called Mosquito Coast. But it has this big problem where the map takes A LOT of time to load. I think it actually kinda gets stuck for some reason, then resumes progress after a while.

Now, initially, I looked at the progress bar, saw where it got stuck (at what percentage) then opened the map and looked what could be causing it. It was getting stuck at around 60%. So I opened it and while I didn't spot anything that caused the problem, the codes which spawns player TC, units and stating stuff were there.

So I started removing them one by one to see if the problem disappears and it did not, HOWEVER, the part where the game gets stuck moved, from 60% to around 30% and this really left me without any idea what could cause it.

I think there's some kind of codes making the game go "wait, what?" for a while until it figures it out, but I simply cannot find them by my self.

If anyone could help it would be highly appreciated. Thanks.
Attachments
Mosquito Coast.xs
(67.28 KiB) Downloaded 40 times
Mosquito Coast.xml
(1.03 KiB) Downloaded 20 times
User avatar
France Rikikipu
Retired Contributor
Posts: 1679
Joined: Feb 27, 2015
ESO: p-of
Location: In your base

Re: Map Questions

Post by Rikikipu »

This is strange, it's not taking time for me when it loads. Are you sure you aren't running any process behind that takes a lot of memory in your comp or that you comp is a bit hold ?
User avatar
Bavaria Gichtenlord
Howdah
Donator 03
Posts: 1437
Joined: Nov 15, 2015

Re: Map Questions

Post by Gichtenlord »

It has several loops with 40*cNumberPlayers and 20*cNumberPlayers, but these loops are still too small to notice, imo.
r]
User avatar
Romania mandosrex
Musketeer
Posts: 57
Joined: Mar 22, 2015

Re: Map Questions

Post by mandosrex »

@Rikikipu Yes, I am very sure it's not because of PC performance as it happens to the players of my mod as well, players with far better computers than mine.

@Gichtenlord I tried looking for 40*cNumberPlayers and 20*cNumberPlayers and nothing pops up, can you tell me I code I can look for or where to look exactly?

Hm... The thing is, I just loaded the original map again, the one I gave you above, and it does indeed load faster. The one modified by me however, has the problem.
But I only changed the visuals of the map, as I did to many other maps, and none had this problem before.

I could add the modified version but you will not be able to load it without my mod, as it uses custom terrain.
But you could look at the codes again, if it's not too big of a request. Thank you.
Attachments
Congo.xs
(61.78 KiB) Downloaded 18 times
Congo.xml
(416 Bytes) Downloaded 31 times
User avatar
Nauru Dolan
Ninja
Posts: 13064
Joined: Sep 17, 2015

Re: Map Questions

Post by Dolan »

If the map loads normally on the unmodded game but loads very slowly on the modded game then there must be some incompatibility between something in the map and your mod.

Unless you modified the map and added some modded objects which take more time to load (textures).

You can always enable Debug mode and check how the map loads step by step, if it's worth the effort.
User avatar
Romania mandosrex
Musketeer
Posts: 57
Joined: Mar 22, 2015

Re: Map Questions

Post by mandosrex »

@Dolan Debug mode? I remember seeing something about that somewhere but can't remember.
How do you enable it?
User avatar
France Rikikipu
Retired Contributor
Posts: 1679
Joined: Feb 27, 2015
ESO: p-of
Location: In your base

Re: Map Questions

Post by Rikikipu »

Download reyk's editor
User avatar
Romania mandosrex
Musketeer
Posts: 57
Joined: Mar 22, 2015

Re: Map Questions

Post by mandosrex »

@Rikikipu Ok so, I got New AoE3 Editor XY (version 3), installed it and opened the editor.

There I see 2 things:
1. When you load a map you have the option Start under debugger.
2. Under Options there's XS Debugger.

Now, I loaded my map but can't see anything else, no loading history/log thing, XS Debugger is empty and I don't know how to use it.

Help.
User avatar
Nauru Dolan
Ninja
Posts: 13064
Joined: Sep 17, 2015

Re: Map Questions

Post by Dolan »

mandosrex wrote:@Dolan Debug mode? I remember seeing something about that somewhere but can't remember.
How do you enable it?

Erm, I think you modify an xml file you find in the User3 folder in your game documents folder.
There's an option in there, I think it was called "EnableRandomMapsDebugging" or something similar. In fact, there must be three of them, for each game mode (RM, campaign and scenario). You need to set all of them to "true". Then restart the game.

Then, when you load a map you should see a step-by-step execution of the map, which will point out any issues the game compiler has with the map script.
User avatar
Romania mandosrex
Musketeer
Posts: 57
Joined: Mar 22, 2015

Re: Map Questions

Post by mandosrex »

@Dolan Aaaaalright, so, after spending an entire day on this I am still no closer to figure it out...

I managed to make the debug appear and something does popup but it still makes no sense. It points to something which has no problem at all AND if i completely remove those lines the problem is still present but the debug doesn't appear anymore because everything "apparently" works well for it...

Image

And if I click run then it stops at this:

Image

Again, even after completely removing those the problem persists and the debug doesn't show anything else.

What is with those Heap things? It says INVALID SYMBOL but I don't know where it is.
User avatar
Nauru Dolan
Ninja
Posts: 13064
Joined: Sep 17, 2015

Re: Map Questions

Post by Dolan »

I don't have the game installed anymore so I can't test it.

But have you tried disabling the code for map clusters on the bottom of the script?

You could also try commenting out everything except for the basic stuff that the map needs to load:
- a main function
- mapsize and terrain initialisation
- players' placement
- players' areas
- a starting unit

Then gradually re-enable everything, piece by piece, to see where it's getting stuck.
User avatar
Romania mandosrex
Musketeer
Posts: 57
Joined: Mar 22, 2015

Re: Map Questions

Post by mandosrex »

Dolan wrote:But have you tried disabling the code for map clusters on the bottom of the script?

Map clusters? What are those? How do the codes look?

Dolan wrote:Then gradually re-enable everything, piece by piece, to see where it's getting stuck.

That's wht I tried for a while but there's just so much...

I suspect there's something with the codes at the start of the map which build the map or something, those above void main(void), they are rather unusual.

Talking about these:

Code: Select all

float PI = 3.1415926535897932384626433832795;
float pow(float x = 0,int p = 0) {
   float x2 = 1;   float x4 = 1; float x8 = 1; float x16 = 1; float x32 = 1; float x64 = 1;
   if(p>=2) x2 = x*x;
   if(p>=4) x4 = x2*x2;
   if(p>=8) x8 = x4*x4;
   if(p>=16) x16 = x8*x8;
   if(p>=32) x32 = x16*x16;
   if(p>=64) x64 = x32*x32;
   float ret = 1;   
   while(p>=64) {   ret = ret * x64; p = p - 64; }   
   if(p>=32) { ret = ret * x32; p = p - 32; }
   if(p>=16) { ret = ret * x16; p = p - 16; }
   if(p>=8) { ret = ret * x8; p = p - 8; }
   if(p>=4) { ret = ret * x4; p = p - 4; }
   if(p>=2) { ret = ret * x2; p = p - 2; }
   if(p>=1) { ret = ret * x; p = p - 1; }
   return (ret);
}
float atan(float n = 0) {
   float m = n;
   if(n > 1) m = 1.0 / n;
   if(n < -1) m = -1.0 / n;
   float r = m;
   for(i = 1; < 100) { int j = i * 2 + 1; float k = pow(m,j) / j;
      if(k == 0) break;
      if(i % 2 == 0) r = r + k;
      if(i % 2 == 1) r = r - k;
   }
   if(n > 1 || n < -1) r = PI / 2.0 - r;
   if(n < -1) r = 0.0 - r;
   return (r);
}
float atan2(float z = 0,float x = 0) {
   if(x > 0) return (atan(z / x));
   if(x < 0) { if(z < 0) return (atan(z / x) - PI);
      if(z > 0) return (atan(z / x) + PI);    
      return (PI);
   }
   if(z > 0) return (PI / 2.0);
   if(z < 0) return (0.0 - (PI / 2.0));
   return (0);
}
float fact(float n = 0) {
   float r = 1;
   for(i = 1; <= n) { r = r * i; }
   return (r);
}
float cos(float n = 0) {
   float r = 1;
   for(i = 1; < 100) {
      int j = i * 2; float k = pow(n,j) / fact(j);
      if(k == 0) break;
      if(i % 2 == 0) r = r + k;
      if(i % 2 == 1) r = r - k;
   }
   return (r);
}
float sin(float n = 0) {
   float r = n;
   for(i = 1; < 100) {
      int j = i * 2 + 1;
      float k = pow(n,j) / fact(j);
      if(k == 0) break;
      if(i % 2 == 0) r = r + k;
      if(i % 2 == 1) r = r - k;
   }
   return (r);
}

float LocX = 0;
float LocZ = 0;
float wAngle = 0;

float getLocX(float xOrigin=0, float rad=0, float MyAngle=0) {
   wAngle = (2*PI*MyAngle)/360;
   LocX=cos(wAngle)*rad + xOrigin;
   return(LocX);
}
   
float getLocZ(float zOrigin=0, float rad=0, float MyAngle=0) {
   wAngle = (2*PI*MyAngle)/360;
   LocZ=sin(wAngle)*rad + zOrigin;
   return(LocZ);
}


I have no idea what they do and how they work but they look messy and deleting them could cause god knows what other problems.
I don't even know what or in what order to delete without breaking the map.
And unfortunately I have to work on other maps as well so that's why I need help.
User avatar
Nauru Dolan
Ninja
Posts: 13064
Joined: Sep 17, 2015

Re: Map Questions

Post by Dolan »

I know what each line in the map does but it's a lot to explain.

Maybe I get the time to re-install the game in the weekend and have a look at the map.

The math equations above are just an implementation of trigonometric functions in AOE3 XS. Since XS lacks trig functions, you can't place objects in a perfect circle (or arc) without some kind of algebraic implementation of cosine, sine and arctangent. The power and factorial functions are needed to build the trig ones.
User avatar
Romania mandosrex
Musketeer
Posts: 57
Joined: Mar 22, 2015

Re: Map Questions

Post by mandosrex »

Math?
Well then...
User avatar
Nauru Dolan
Ninja
Posts: 13064
Joined: Sep 17, 2015

Re: Map Questions

Post by Dolan »

The trig functions are used to create player areas in FFA, IIRC.

Who is online

Users browsing this forum: No registered users and 2 guests

Which top 10 players do you wish to see listed?

All-time

Active last two weeks

Active last month

Supremacy

Treaty

Official

ESOC Patch

Treaty Patch

1v1 Elo

2v2 Elo

3v3 Elo

Power Rating

Which streams do you wish to see listed?

Twitch

Age of Empires III

Age of Empires IV