You must be logged in to post messages.
Please login or register

Scenario Design
Moderated by MosheLevi, Mister SCP

Hop to:    
Welcome! You are not logged in. Please Login or Register.735 replies, Sticky
Age of Empires III Heaven » Forums » Scenario Design » The RMS question Thread
Bottom
Topic Subject:The RMS question Thread
« Previous Page  1 ··· 10 ··· 20 ··· 27 28 29 30  Next Page »
RF_Gandalf
Skirmisher
posted 04-27-06 06:09 AM EDT (US)         
This thread is intended for discussion of questions regarding Random Map Scripting for AOE3. Instead of posting questions separately in the forum, use this thread which will serve as a collection of (?)wisdom for those looking for information. I will be checking this thread at least several times per week, and I hope that the other experienced scripters will join in to add their wisdom.

For those seeking some basic starting help, try these links to some helpful information:
The Age of Wiki has a useful section on Random Map Scripting.

An AOE3RMS Tutorial by MOnTy PyThOn is a pretty complete guide to help you understand the various commands.

Finally, try downloading some of the map scripts at the Age of Empires IIIHeaven RMS Download section and open the map scripts in a text editor and check them out to see how it is done. You could also open the map scripts that came with the game to study their commands; these will be found in the directory: Program Files\Microsoft Games\Age of Empires III\rm.

So post any RMS questions here, we will try to help!

AuthorReplies:
musketeer925
Skirmisher
posted 05-22-14 02:13 PM EDT (US)     701 / 735       
I'll make neuron's day a bit easier...
int Waterlevel = rmRandInt(1,2);
Creates a variable named Waterlevel, and assigns a value of either 1 or 2 randomly (as these are the only integers between 1 and 2 inclusively). Doesn't do anything to the map on its own.
What does this do?: if ( waterlevel == 1 ) { // waterlevel is Flood
It opens an if statement to do something if that Waterlevel variable equals 1. Note that it actually should be Waterlevel, the way it was defined, variables are case sensitive. Be sure to close it with a end brace }
What does this do?: rmTerrainInitialize("new_england\ground3_ne",10);
Begins the map by building a single type of land across the whole map. I think the 10 is map height. You can also initialize to "water" and omit a ground height to start with an all-water map (whereupon you would use rmSetSeaLevel(1.0); to define the water's height).
rmSetMapType("saguenay");
SetMapType just adds map types to a map. Map types can define what treasures appear, which birds fly overhead, AI behavior, which mercs appear, and other things.
// rmSetGlobalSnow( 0.7 );
Makes snow particles appear in the sky, with 70% intensity. Commented as he didn't want it to be snowing.

For the rest see your other thread... for the most part you cannot copy huge chunks of code and expect things to work.
dietermoreno
Skirmisher
posted 06-04-14 01:13 AM EDT (US)     702 / 735       
Hello gentlemen.

I changed the area coordinates of the water to 0.20, 0.80 and it indeed puts the water on the left of the map.



But you can see in the screen shot that the water is still too "circular" and not "long" enough for an ocean coast.


When I added influence segment it just caused the map to fail to load.

rmAddAreaInfluenceSegment(OceanID, 0.10, 0.70, 0.30, 0.90);

When I commented off the influence segment the map loaded, but with still the circular water.




So next I tried to make the map rectangular to encourage the water to place rectangularly.

rmSetMapSize(1500, 3000);



Unfortunately, when I made the map rectangular I only saw black and the "You abandon your colony" message on screen occured as soon as the map loaded.

So I thought maybe this means the town centers are being placed still circular even though the map is rectangular which causes the town centers to not be placed.

So then I tried adding

rmPlacePlayersSquare(1000, 3000, 0);

The town centers still didn't place and "You abandon your colony" message.



Right now the whole script is:

Pacific Mexico.xs


What to do now?

Mummy zombies on the Nile map is actually more historically accurate than tanks being destroyed by pikemen.

Want denser forests and a huge Amazon?
dietermoreno
Skirmisher
posted 06-08-14 01:44 AM EDT (US)     703 / 735       
Azimk
Though I don't know how much success you'll have with decompiling the exe, I think many others have tried before without any success.
It has been successfull for disassembling and hex editing in this file here!: http://aoe3.heavengames.com/downloads/showfile.php?fileid=3405&f=2

Just thought I'd comment this to let people know when they google "decompile aoe3 exe" to see if its possible, to let them know that its currently impossible but some things can be done with hex editing.

Mummy zombies on the Nile map is actually more historically accurate than tanks being destroyed by pikemen.

Want denser forests and a huge Amazon?

[This message has been edited by dietermoreno (edited 06-08-2014 @ 01:47 AM).]

Randomplayer
Skirmisher
posted 06-08-14 05:11 PM EDT (US)     704 / 735       
What to do now?
Well, first of all, your map is huge. Do you really need 1500 metres / 3000 m? That's about the size of 50 Great Plains maps one next to another, placed in a rectangle 5 wide / 10 long. I'm sure this size makes your map load slowly, so I would decrease the size substantially. Somewhere under 600/600.

You need to add a layer of noise for the ground. Right now the map is flat. So, you can use something like that:
rmSetMapElevationParameters(cElevTurbulence, 0.05, 4, 0.5, 4.5);

Next, the map must have some basic terrain pattern, which could be either a land brush or a terrain mix from the editor. Look in the editor to find the brushes and mixes names, then write the path to each of them. For example, the default terrain pattern for AOE3 is the one you see in the editor:

great_plains\default

There are many more, such as:

Deccan\ground_grass2_deccan
saguenay\ground4_sag
Mongolia\ground_grass3_mongol
rockies\groundsnow6_roc

etc etc.

Mixes have names like:

patagonia_snow
deccan_grassy_Dirt_a,
mongolia_grass_b

You have to give all this information to the game engine before initialising the map terrain. You can either initialise the map with a brush OR with a mix. Not both. If you put both commands, the mix will have priority (I think). If you don't specify a the base mix, the terrain brush you choose will be used to paint the foundation of the map.

So you can use these commands:

rmSetBaseTerrainMix("patagonia_snow"); // This must come before the the terrain initialisation to be taken into account
rmTerrainInitialize("great_plains\default", -4.0); // This comes last, after the noise layer and the base mix, map type, etc.

You also need a map type, so you get a soundscape and a treasure set:

rmSetMapType("land");
rmSetMapType("Siberia");

These commands must be placed before the map initialisation command also to work properly.

.......

There is more work to fix your map, I'll just point one solution to your problem. You can give the Town centers more floating space to place. So:

int TCID = rmCreateObjectDef("Player TC"+i);
rmAddObjectDefItem(TCID, "TownCenter", 1, 0.0);
rmSetObjectDefMinDistance(TCID, 0.0);
rmSetObjectDefMaxDistance(TCID, rmXFractionToMeters(0.5));
dietermoreno
Skirmisher
posted 06-15-14 03:21 AM EDT (US)     705 / 735       
Thank you very much for your advice RandomPlayer.

Unfortunately, I got a "You Abandon your colony" message and the screen was black when the map finished loading.

What are possible causes of this symptom occuring could you please tell me if you know?

Here is the script I tried : test script

Mummy zombies on the Nile map is actually more historically accurate than tanks being destroyed by pikemen.

Want denser forests and a huge Amazon?
Randomplayer
Skirmisher
posted 06-15-14 06:40 AM EDT (US)     706 / 735       
Have you tried this map on the game without expansions (vanilla)? I tested it in 1v1, 2v2 and 3v3 and worked fine.

However, when I tested on TAD, the map loads, but it crashes the game (which might not be from the map, but from the game using too much memory for generating a too large map). Once I decrease the size of the map to more normal values (like 300,300) the map loads fine and there's no You abandon your colony message. I would try decreasing the map size to under (600,600) and see if you get the same result. I only tested in 1v1 on TAD, so it's possible that there's some nasty combination between the map being huge, rectangular and having square player placement with a big lake on a side.
dietermoreno
Skirmisher
posted 06-16-14 00:00 AM EDT (US)     707 / 735       
That's wierd, I made a map with FORESTS that have area size of 1800x4800 tiles and the whole map is 84,000 tiles and the map always loads in TAD.

Its available in the RM download section of this site named "Huge Amazon" and already like 80 people have downloaded it and no one has commented to complain that it doesn't work.




Well I tried decreasing my map to 300x300 tiles and it worked.

I also tried 1500x1500 tiles and it worked.

I tried 1500x3000, 3000x1500, 1500x4000, and 2000x4000 and none of those combinations worked.

I'm not sure how the rectangular placement works.

// Use this function to set the map size
//rmSetMapSize(1500, 3000);
//map size changed to 300x300 tiles to attempt to stop the game from crashing as soon as the map loads giving black screen and "You abandon your colony" message
//rmSetMapSize(300, 300);
//map size 300x300 worked. Now see if its the size that caused the bug or if its the rectangular size (1500x3000 is rectangular).
rmSetMapSize(1500, 1500);
//map size 1500x1500 worked. Its not the size that caused the bug, its the rectangular size. Now try to reverse the rectangle orientation to get the rectangle to line up with the rectangle placement of the towncenters.
//It appears that rectangular map size MUST be compatible with the rectangular placement of the town centers or else the game crashes and gives "You abandon your colony" message.
//rmSetMapSize(3000, 1500);
//map size 3000x1500 didn't work.
//"rmPlacePlayersSquare (1000, 3000, 0);"... So that appears to be the rectangular placement orientation. Maybe 1500x3000 with player placement 1000x3000 with a lake 0.15 times the size of the map size (0.15*1500=225) isn't enough room.
//0.15*3000=450 ... So the lake is 225x450. 225+1000 = 1225 1225 < 1500 Check. 450+3000 = 3450 3450 > 3000 Error found.
//Try increasing the map size to 1500x4000 to debug.
//rmSetMapSize(1500, 4000);
//map size 1500x4000 didn't work. Weird. Maybe rectangular maps have a hard coded game engine limitation of being limited to one axis being no larger than twice the size of the other?
//Try increasing the map size to 2000x4000 to debug.
//rmSetMapSize(2000, 4000);
//Nope didn't work.


Also I tried to change the elevation turbulance multiplying every value by 10 and when I changed it I got:





Hard crash of the game that required task manager to close the game.

The game never actually crashed interestingly, just it was incredibly slow. Like 3 seconds of game time was in the real world for me closer to 30 seconds before clicking the resign button did anything because the map was apparently still trying to do something.

After I clicked resign the whole window went black and closed and when the window opened again a few seconds later I saw the whole map before going to task manager. Clicking quit didn't work because the map was apparently still trying to do something?

This is the halting problem in computing? That is, the program doesn't understand how many times it should keep performing a routien and performs the routein infinately until the program is hard shut down.

To stop the halting problem for forest placement, I noticed that in Amazon script the script says to give up after I think it was 5 attempts so then the map will just load without forest instead of trying infinately so you can shut down the game normally without doing a hard shutdown.


//Add map noise level (so it isn't flat)
//rmSetMapElevationParameters(cElevTurbulence, 0.05, 4, 0.5, 4.5);
//Now the map would almost look like a legit map if it had resources. No elevation turbulance just doesn't look realistic.
//Increasing the elevation turbulance to very different values from each other is a way to make random mountains? Let's test it and try to make the map look even more legit.
//rmSetMapElevationParameters(cElevTurbulence, 0.05, 40.0, 50.0, 45.0);
//Nope... sh!ts crazy! Towncenters place on minimap all over the screen as seen in the screen shots and hard crash of the game that needs task manger to shut down the game.
//Maybe that's too much elevation turbulence to place towncenters? Or maybe its something else? Maybe I don't understand the function arguments of the "rmSetMapElevationParameters()" function?
//Try function argument values 0.05, 8, 0.5, 9 to debug
//rmSetMapElevationParameters(cElevTurbulence, 0.05, 8, 0.5, 9);
//Doubling the function argument float values worked. Let's see what quadrupaling does to continue to debug.
rmSetMapElevationParameters(cElevTurbulence, 0.05, 16, 0.5, 18);

Anyway, the elevation turbulance worked when I quadrupaled two of the values, but didn't change the other two values.

What do each one of the four values do?




So it appears that elevation turbulance varies the elevation of an area, and if no area is defined it can by default make the whole map be uniformly randomly mountainous as seen in the screen shot?

Is there a difference between elevation turbulance of a defined mountain area and creating areas with mountains or is that how mountains are created?

Mummy zombies on the Nile map is actually more historically accurate than tanks being destroyed by pikemen.

Want denser forests and a huge Amazon?

[This message has been edited by dietermoreno (edited 06-16-2014 @ 02:18 AM).]

Randomplayer
Skirmisher
posted 06-16-14 05:26 AM EDT (US)     708 / 735       
What do each one of the four values do?
There are 5 parameters:

1. Elevation type can be: cElevationNormal, cElevationFractalSum and cElevationTurbulence

2. Minimum frequency is the minimum fraction of area to convert to elevation type. It takes float values between 0.00 and 1.00.

3. Number octaves is the amount of times the defined elevation noise is repeated in the area. If it's set to zero (or below), the map will be flattened (ie, no elevation difference is repeated) and the ground height will be set to the lowest possible value of height variation.

4. Persistence can take float values between 0.0 and 1.0. Higher values make the bumps in the ground look more jagged.

5. Height variation is the difference between the highest and the lowest point on the map (only as far as the terrain is concerned, not map objects).
The height variation number represents the interval of possible variation in height (up and down), relative to an average value, which is the height of the initialised terrain (for example if HV is 6 and the terrain is initialised at 0, terrain height will vary from -3 to 3).
dietermoreno
Skirmisher
posted 08-16-14 02:48 AM EDT (US)     709 / 735       
Hello, I am trying to add more islands to the Great Lakes map, and it didn't work.

I made Great Lakes huge to 100,000 tile size per player to be sure the lake is huge so the islands won't interfer with each other's placement, and the new island failed to place every time.

I tried moving it to different places in the middle of the map, still failed to place.


I'm guessing this is the relevant part:

// ********************* create LAKE ISLANDS *********************

if (seasonPicker < 0.5)
{
int tradeIslandA=rmCreateArea("trade island A");
rmSetAreaSize(tradeIslandA, rmAreaTilesToFraction(300), rmAreaTilesToFraction(300));
//rmSetAreaLocation(tradeIslandA, 0.5, 0.5);// dieter changes - adjust island A placement for the other island!
rmSetAreaLocation(tradeIslandA, 0.4, 0.4);
rmAddAreaToClass(tradeIslandA, classGreatLake);
rmAddAreaToClass(tradeIslandA, rmClassID("tradeIslands"));
rmSetAreaBaseHeight(tradeIslandA, 2.0);
//if (seasonPicker < 0.5)
rmSetAreaTerrainType(tradeIslandA, "great_lakes\ground_grass1_gl");
//else
//rmSetAreaTerrainType(tradeIslandA, "great_lakes\ground_snow2_gl");
rmSetAreaElevationType(tradeIslandA, cElevTurbulence);
rmSetAreaMinBlobs(tradeIslandA, 3);
rmSetAreaMaxBlobs(tradeIslandA, 5);
rmSetAreaMinBlobDistance(tradeIslandA, 4);
rmSetAreaMaxBlobDistance(tradeIslandA, 7);
rmSetAreaSmoothDistance(tradeIslandA, 10);
rmSetAreaCoherence(tradeIslandA, 0.7);
rmBuildArea(tradeIslandA);

//dieter changes - add another island!
int tradeIslandB=rmCreateArea("trade island B");
rmSetAreaSize(tradeIslandB, rmAreaTilesToFraction(900), rmAreaTilesToFraction(300));
rmSetAreaLocation(tradeIslandB, 0.5, 0.3);
rmAddAreaToClass(tradeIslandB, classGreatLake);
rmAddAreaToClass(tradeIslandB, rmClassID("tradeIslands"));
rmSetAreaBaseHeight(tradeIslandB, 2.0);
//if (seasonPicker < 0.5)
rmSetAreaTerrainType(tradeIslandB, "great_lakes\ground_grass1_gl");
//else
//rmSetAreaTerrainType(tradeIslandB, "great_lakes\ground_snow2_gl");
rmSetAreaElevationType(tradeIslandB, cElevTurbulence);
rmSetAreaMinBlobs(tradeIslandB, 3);
rmSetAreaMaxBlobs(tradeIslandB, 5);
rmSetAreaMinBlobDistance(tradeIslandB, 4);
rmSetAreaMaxBlobDistance(tradeIslandB, 7);
rmSetAreaSmoothDistance(tradeIslandB, 10);
rmSetAreaCoherence(tradeIslandB, 0.7);
rmBuildArea(tradeIslandB);
}

Or am I missing something else? Constraints?

Caribean has:

// Bonus area constraint.
int islandConstraint=rmCreateClassDistanceConstraint("islands avoid each other", classIsland, 55.0);
// int bonusIslandConstraint=rmCreateClassDistanceConstraint("bonus islands avoid islands", classIsland, 30.0);
int avoidBonusIslands=rmCreateClassDistanceConstraint("stuff avoids bonus islands", classBonusIsland, 30.0);
int avoidTeamIslands=rmCreateClassDistanceConstraint("stuff avoids team islands", classTeamIsland, 30.0);


So I could do:

// Island avoidance constraints. -- dieter
int islandConstraint=rmCreateClassDistanceConstraint("islands avoid each other", classIsland, 55.0);
// int TradeIslandConstraint=rmCreateClassDistanceConstraint("trade islands avoid islands", classIsland, 30.0);
int avoidTradeIslands=rmCreateClassDistanceConstraint("stuff avoids trade islands", classtradeIslands, 30.0);
//int avoidTeamIslands=rmCreateClassDistanceConstraint("stuff avoids team islands", classTeamIsland, 30.0);//


My constraints didn't work. The new island still didn't appear. Only one island appears instead of two islands.

Or maybe its something else not related to constraints.

I'm actually not sure which island is appearing, mine or original.

I tried to make my island to be 3 times as long as wide in the opposite direction as I made the original island, but the island still shows up circular no matter how big I make the island. Must have something to do with circular constraints for the islands, that I don't have a knowledge of.

Mummy zombies on the Nile map is actually more historically accurate than tanks being destroyed by pikemen.

Want denser forests and a huge Amazon?

[This message has been edited by dietermoreno (edited 08-16-2014 @ 03:48 AM).]

Pikerush21
Skirmisher
posted 08-16-14 07:10 AM EDT (US)     710 / 735       
Your minimum size is greater than the maximum size.
rmSetAreaSize(tradeIslandB, rmAreaTilesToFraction(900), rmAreaTilesToFraction(300));
That doesn't make sense to the game compiler.

If it still doesn't work, comment all constraints, decrease size, place it further away from the original island, etc.
dietermoreno
Skirmisher
posted 08-16-14 01:10 PM EDT (US)     711 / 735       
EDIT


Problem solved: I forgot to copy and paste the modified map into the 'Microsoft Games/Age of Empires III/RM/' and only copy and pasted it into 'Documents/My Games/Age of Empires III/RM/', so that caused the game engine to get confused and only load the version in the Microsoft Games directory.

Now that I copy and pasted correctly the file, now my islands appear.

My map originally had initialization failed until I made the islands much smaller to only 600, 1800 and 1800,600 , commented off my constraints, and commented off my elevation changes.

My islands were at first coliding with the mainland and coliding with each other until I played around with the placement decimals.



The original island (enlarged) has trees, mines, and treasure, but my new island does not.

I presume that constraints put those things on islands.


Edit: No, placement functions put those things on islands.

both my islands now have trees, mines, deers, and treasures.

I even gave the middle island a native village successfully.

Mummy zombies on the Nile map is actually more historically accurate than tanks being destroyed by pikemen.

Want denser forests and a huge Amazon?

[This message has been edited by dietermoreno (edited 08-17-2014 @ 09:01 PM).]

Pikerush21
Skirmisher
posted 08-16-14 02:11 PM EDT (US)     712 / 735       
The maximum size of the map?
No, I mean the syntax for this command which sets an area size is:

rmSetAreaSize(int areaID, float minFraction, float maxFraction);

areaID - is your defined object ID
minFraction - is the minimum size value
maxFraction - is the maximum size value

You set a minimum size value (900) which is bigger than the maximum size value (300). This makes the island fail to show up.

The same thing happens if you try to generate a random integer number and you use the wrong range

rmRandInt(9, 3);

The function fails to work. But if you use the range right

rmRandInt(3, 9);

It werks.
dietermoreno
Skirmisher
posted 08-16-14 02:20 PM EDT (US)     713 / 735       
The map did not crash when I made the maximum value of 600 be smaller than the minimum value of 1800. both islands still appeared.

I thought the area size syntax controlled how long the island is.

Or does the placement syntax control how long the island is.

So the area size syntax is designed to randomly make the islands different sizes everytime within the max and min size values?

I thought the placement syntax just plots the center of the island in a coordinate axis, and the center of the island has length and width determined by the area size syntax.

Or is there no way to control the exact length and width because its intented to be random.

Like I want the island to be longer than wide, but its not possible and that's why the island always looks circular?

Mummy zombies on the Nile map is actually more historically accurate than tanks being destroyed by pikemen.

Want denser forests and a huge Amazon?

[This message has been edited by dietermoreno (edited 08-16-2014 @ 02:22 PM).]

Pikerush21
Skirmisher
posted 08-16-14 03:16 PM EDT (US)     714 / 735       
Basically the size function says how much terrain "material" you have to build an area.

To make an area be longer on one side, use the area influence segment function:

rmAddAreaInfluenceSegment(int areaID, float xFraction1, float zFraction1, float xFraction2, float zFraction2);

xFraction1 and zFraction1 define the starting point of the influence segment.

xFraction2 and zFraction2 define the end point of the influence segment.


BUT - if you create an area influence segment with coordinates which are too far away from the area location coordinates, it's possible the segment will not show up, so you will only get one blob of terrain.

Since the area size defines the land material you have to build an area, when you define an area segment, the more you "stretch" the segment, the thinner the area becomes.

That's why I said the area size function defines the available material for building an area, because the material has a fixed size (map fraction or some floating value like 0.1), whereas the segment can be stretched any way you want.

You can also add more segments to compose an area with a complex appearance. But if you don't also increase area size, the more segments you add, the skinnier they get. So, the more segments you add, the more you also have to increase area size if you want them to keep their thickness.
Or is there no way to control the exact length and width because its intented to be random.
The size is random when you set a range with different minimum and maximum values (such as: 0.1, 0.125). Then the game can choose an area size which can be anything between 0.1 and 0.125.
that's why the island always looks circular?
Area look circular by default if the area coherence is set at maximum (1.0). If you set a lower coherence value (0.1) the area shape gets more irregular, it can even spread around like a blotch.
dietermoreno
Skirmisher
posted 08-17-14 03:44 AM EDT (US)     715 / 735       
Since the area size defines the land material you have to build an area, when you define an area segment, the more you "stretch" the segment, the thinner the area becomes.
Sorry for my bluntness, but how exactly do you control how much "stretch" the segment has?

Or did you just describe it and I didn't understand.

As in: you don't stretch it; the segment stretches the area more of less depending on how much of the area is defined to be in the segment?

So if the whole segment was in the area, then it wouldn't do anything and the whole area would stay the same?

So the less the segment is in the area, the more stretched the area becomes?


Well, I did kind of find a work around without using segments. I actually combined islands together to form long islands and bays, but this isn't how the ES people originally made the maps, so I'm sure this isn't the ideal way to do it.

On a minor side note, so much stuff that the ES people didn't do that you see commented off. Like Great Lakes was supposed to have islands in the winter too, New England was supposed to have huge cliffs on the waterfront, Texas was supposed to have forts, and more. "...We will remove the cliffs for now..." - typed in 2002. Later never came...

I wonder if having ice and islands at the same time would be too complicated.

Mummy zombies on the Nile map is actually more historically accurate than tanks being destroyed by pikemen.

Want denser forests and a huge Amazon?

[This message has been edited by dietermoreno (edited 08-17-2014 @ 03:48 AM).]

Pikerush21
Skirmisher
posted 08-17-14 07:46 AM EDT (US)     716 / 735       
Sorry for my bluntness, but how exactly do you control how much "stretch" the segment has?

Or did you just describe it and I didn't understand.

As in: you don't stretch it; the segment stretches the area more of less depending on how much of the area is defined to be in the segment?
I'll give you an example

If you define an area with size 0.1, 0.1

rmSetAreaSize(areaID, 0.1, 0.1);

And then set its location

rmSetAreaLocation(areaID, 0.5, 0.5);

Then if you want to make the area look longer, you can use an influence segment:

rmAddAreaInfluenceSegment(areaID, 0.4, 0.5, 0.6, 0.5);

This will make the area look long and thick. But if you define the segment like this:

rmAddAreaInfluenceSegment(areaID, 0.2, 0.5, 0.8, 0.5);

The area will look longer but also very thin. Why is that? Because, as I said, the area size is your building material, and the more you spread an area on the map using the same size, the thinner the area gets. So, if you want to keep it's thickness, you would also have to increase the size everytime you also increase the area spread.
dietermoreno
Skirmisher
posted 08-17-14 08:57 PM EDT (US)     717 / 735       
Initialization failed with my influence segment. Intialization failed, intialization does not fail when I comment off the influence segment.

I used:

rmAddAreaInfluenceSegment(areaID, 0.42, 0.52, 0.60, 0.50);

In context of:

// ********************* create LAKE ISLANDS *********************

if (seasonPicker < 0.5)
{
int tradeIslandA=rmCreateArea("trade island A");
//rmSetAreaSize(tradeIslandA, rmAreaTilesToFraction(300), rmAreaTilesToFraction(300));//
//original above//
//rmSetAreaSize(tradeIslandA, rmAreaTilesToFraction(600), rmAreaTilesToFraction(1800));//
//rmSetAreaSize(int areaID, float minFraction, float maxFraction);// - Parameters of the function if use fractions from 0.0 to 1.0
//rmSetAreaSize(int areaID, rmAreaTilesToFraction(min int), rmAreaTilesToFraction(max int);// - Parameters of the function and it converts tiles to fractions for you.
//This island is oriented 3 times longer NW than NE.//-No its not.
rmSetAreaSize(tradeIslandA, rmAreaTilesToFraction(1200), rmAreaTilesToFraction(1200));
//Make the island the same size everytime to debug the map initialization failed.//

//rmSetAreaLocation(tradeIslandA, 0.5, 0.5);// dieter changes - adjust island A placement for the other island!
//rmSetAreaLocation(tradeIslandA, 0.4, 0.4);// - Too far south for the island. The second decimal value appears to control North/South.
//rmSetAreaLocation(tradeIslandA, 0.4, 0.5);// - Too far south west for the island. The first decimal value appears to control NE/SW, NOT E/W. >0.5 is NE, <0.5 is SW.
//The second decimal value appears to control NW/SE, NOT N/S. >0.5 is NW, <0.5 is SE. //
rmSetAreaLocation(tradeIslandA, 0.52, 0.5);
//rmSetAreaLocation(int areaID, float xFraction, float zFraction);// - Parameters of the function
rmAddAreaToClass(tradeIslandA, classGreatLake);
rmAddAreaToClass(tradeIslandA, rmClassID("tradeIslands"));
rmSetAreaBaseHeight(tradeIslandA, 2.0);
//if (seasonPicker < 0.5)
rmSetAreaTerrainType(tradeIslandA, "great_lakes\ground_grass1_gl");
//else
//rmSetAreaTerrainType(tradeIslandA, "great_lakes\ground_snow2_gl");
rmSetAreaElevationType(tradeIslandA, cElevTurbulence);
rmSetAreaMinBlobs(tradeIslandA, 3);
rmSetAreaMaxBlobs(tradeIslandA, 5);
rmSetAreaMinBlobDistance(tradeIslandA, 4);
rmSetAreaMaxBlobDistance(tradeIslandA, 7);
rmSetAreaSmoothDistance(tradeIslandA, 10);
rmSetAreaCoherence(tradeIslandA, 0.7);
//old above.//
//rmSetAreaCoherence(tradeIslandA, 0.35);//
//Made the island twice as jagged and lesss circular.//
//A little too serpentine. The island is so long it touches land.//
//rmSetAreaCoherence(tradeIslandB, 0.5);//
//Comment off coherence to debug.//
//One island is more skinny than the other island.//
//rmAddAreaInfluenceSegment(areaID, 0.4, 0.5, 0.6, 0.5);// - What would use to make island longer if the island was at 0.5, 0.5 location.
//Island is stretched by +/- 0.1 fraction from the starting coordinates 0.5, 0.5 //
//rmAddAreaInfluenceSegment(int areaID, float xFraction1, float zFraction1, float xFraction2, float zFraction2);// - parameters of the function
//rmAddAreaInfluenceSegment(areaID, 0.2, 0.5, 0.8, 0.5);//
//Island is strecthed by +/- 0.3 fraction from the starting coordinates 0.5, 0.5 More stretch than +/- 0.1 fraction. //
rmAddAreaInfluenceSegment(areaID, 0.42, 0.52, 0.60, 0.50);
//Comment off influence segment to debug.//
//Island is stretched by +/- 0.1 fraction from the starting coordinates 0.52, 0.5.//
rmBuildArea(tradeIslandA);

Mummy zombies on the Nile map is actually more historically accurate than tanks being destroyed by pikemen.

Want denser forests and a huge Amazon?
Pikerush21
Skirmisher
posted 08-17-14 09:15 PM EDT (US)     718 / 735       
This line has to be changed

rmAddAreaInfluenceSegment(areaID, 0.2, 0.5, 0.8, 0.5);

to

rmAddAreaInfluenceSegment(tradeIslandA, 0.2, 0.5, 0.8, 0.5);

I used a generic area name (areaID), you have to adapt examples to your script.
dietermoreno
Skirmisher
posted 08-18-14 01:07 AM EDT (US)     719 / 735       
Oh silly me.

My map looks great now, at least to how I envisioned it originally.

The lake islands geography, mines, trees, natives, fisheries, and trading posts is loosely based on the history of the Apostle Islands in Lake Superior. 3 centuries of colonial war fare with natives, later French voyagers in the 17th century, later the British navy in the 18th century, and later American fur trappers in the 19th century. The current name for the map is Lake Superior, as naming it after a chain of American lake islands would be too American-centric and no one who doesn't live in Wisconsin would ever have heard of it before.



I tried to add a trading post socket, and was successful, but I'm not sure what to do next to create a water trade route.


When I tried to add a dock nature controlled socket, initialization failed:

// Player constraints
int playerConstraintForest=rmCreateClassDistanceConstraint("forests kinda stay away from players", classPlayer, 20.0);
int longPlayerConstraint=rmCreateClassDistanceConstraint("land stays away from players", classPlayer, 70.0);
int mediumPlayerConstraint=rmCreateClassDistanceConstraint("medium stay away from players", classPlayer, 40.0);
int playerConstraint=rmCreateClassDistanceConstraint("stay away from players", classPlayer, 45.0);
int shortPlayerConstraint=rmCreateClassDistanceConstraint("stay away from players short", classPlayer, 20.0);
int avoidTradeIslands=rmCreateClassDistanceConstraint("stay away from trade islands", rmClassID("tradeIslands"), 40.0);
int smallMapPlayerConstraint=rmCreateClassDistanceConstraint("stay away from players a lot", classPlayer, 70.0);
//Adds dock constraints//
//Intialization failed imediately if error here.//
//int nearWater10 = rmCreateTerrainDistanceConstraint("near water", "Water", true, 10.0);
//int nearWaterDock = rmCreateTerrainDistanceConstraint("near water for Dock", "Water", true, 0.0);
//Comment off to debug//


...

//Docks. Initialization failed at end if docks caused the crash.//
//Comment off to debug.//

//vector waypointLoc = rmGetTradeRouteWayPoint(tradeRoute1ID, 0.50);
//vector closestLoc = rmFindClosestPointVector(waypointLoc, rmXFractionToMeters(1.0));

//int dockID = rmCreateObjectDef("trade dock");
//rmAddObjectDefItem(dockID, "Dock", 1, 1);
//rmSetObjectDefMinDistance(dockID, 1);
//rmSetObjectDefMaxDistance(dockID, 100);
//rmAddObjectDefConstraint(dockID, landIslandConstraint);
//rmPlaceObjectDefAtLoc(dockID, 0, rmXMetersToFraction(xsVectorGetX(closestLoc)), rmZMetersToFraction(xsVectorGetZ(closestLoc)), 1);

The water trade route dock code is from Neuron's map that he made for Wotta.

Mummy zombies on the Nile map is actually more historically accurate than tanks being destroyed by pikemen.

Want denser forests and a huge Amazon?

[This message has been edited by dietermoreno (edited 08-18-2014 @ 02:48 AM).]

Pikerush21
Skirmisher
posted 08-18-14 07:45 AM EDT (US)     720 / 735       
What's a water trade route? A trade route that goes through water?

That code doesn't make much sense. It looks like a dock was placed next to a trade route, in the closest spot on the shores. But how is that a water trade route?
dietermoreno
Skirmisher
posted 08-18-14 11:57 PM EDT (US)     721 / 735       
So I tried to make a trade route and it didn't work. I made it go on water and initialization failed. I commented off the lake and intialization still failed. Then when I un-commented the lake and commented off the trade route the map loads.



Can you please help me find the error?
The error is somewhere here:

//****************************WATER TRADE ROUTE*************************************************************************************************

//Reference of location from Great Lakes ice sheet to know where the water is.
//rmSetAreaLocation(IceArea1ID, 0.45, 0.50);




int socketID=rmCreateObjectDef("sockets to dock Trade Posts");
rmAddObjectDefItem(socketID, "SocketTradeRoute", 1, 0.0);
rmSetObjectDefAllowOverlap(socketID, true);
rmSetObjectDefMinDistance(socketID, 0.0);
rmSetObjectDefMaxDistance(socketID, 6.0);
rmAddObjectDefConstraint(socketID, shortAvoidTradeRoute);

rmAddRandomTradeRouteWaypoints(tradeRouteID, 0.08, 0.55, 2, 3); // -12
//Across the lake from the other waypoint.
rmAddRandomTradeRouteWaypoints(tradeRouteID, 0.86, 0.68, 2, 3);
//Only 2 waypoints in this experiment.

//rmEchoError
bool placedTradeRoute = rmBuildTradeRoute(tradeRouteID, "dirt");
if(placedTradeRoute == false)
rmEchoError("Failed to place trade route #1");

//Put waypoints same place as sockets.

rmPlaceObjectDefAtLoc(socketID, 0, 0.86, 0.68); //-5
rmPlaceObjectDefAtLoc(socketID, 0, 0.08, 0.55); //-12

//Text
rmSetStatusText("",0.30);
//Water trade route placed.
//If the progress bar moved 3 times before crashing, the error is after the water trade route placed.
//Comment off the water trade route to debug.
What's a water trade route? A trade route that goes through water?


on Wotta facebook






another one showing the actual route


Also I got in a fight with AoE_Fan [http://www.knightsandbarbarians.com/t520-is-dalmatia-rm-included-in-the-current-release-of-kb]here

Copy right enfringement lol.

I'm not allowed to use his code or else he will take down any RMs I upload that use it.

So I have to learn how to do it independently.



Moving right along pretending I didn't just start drama...
That code doesn't make much sense. It looks like a dock was placed next to a trade route, in the closest spot on the shores. But how is that a water trade route?
Interesting. Neuron's code uses a dock on this thread, but Tahattus's code uses a trade post in the Facebook images. No clue what the relation is. The only relation that I see is that Neuron made the dock GAIA and Tahattus made the trade ships GAIA (the ships fly the pirate flag).


Maybe the trade units are always GAIA and I didn't realize it until now because the train doesn't fly a pirate flag.

It is indeed possible to edit the trade units. Wotta has different trade units on Latin American RMs (on land).

So I would just have to change the trade units to be caravel instead of travois.

I think someone in Wotta told me at some time that its not possible to have both land and water trade route at the same time, if I remember correctly.

In Wotta, the LA maps have the new trade units.

Wotta image

Someone from Wotta on the Wotta Facebook told me that African maps will also have new trade units different from the LA maps.

So presumably, the pattern is that there is a file that defines what maps have what trade units.

So that's why you can't have both a land trade route and a water trade route at the same time.



Someone in 2007 said in AoE3H forums that the name of the file is traderoutes.xmlhere

I'll look at that file now.



Edit: I looked at that file and I'm not really sure what modifications you can make to it. It just references what the trade route looks like "stone", "dirt", or "train" with the upgrade tech in tech tree referenced to. Looks like those are the only things you can modify on that file.

So more information is contained in the techtree.

TradeRouteUpgrade1[/code] is the tech referenced to.


Its tech effects are just
[code]
<Effects>
<Effect type ='Data' amount ='1.00' subtype ='UpgradeTradeRoute' relativity ='Absolute'>
<Target type ='Player'></Target></Effect></Effects>

So the tech effect type is UpgradeTradeRoute.

So more information on how the trade route is defined is contained in a file that defines what tech types are I would think.

I can't find that file.

Someone in Wotta said that the information for trade routes is in a hidden file.

The file I desire must be either the "hidden file" or link to the hidden file or link to a file that links to the hidden file.


Looking in the "numbered folders" like "1048", there are .dll files in each folder, that are binary code when you attempt to open in Notepad++ which is of course un-editable to humans.

My current guess is that trade route is controlled by one of those binary files that we can not modify directly, and apparently Wotta, NE, and KnB use some sort of disassembler like IDA Pro to generate pseudo code and use a hex editor to then edit the hex to allow water trade routes.

This is all guess work.

Your guess is as good as mine.




Well, ignoring the fact that stage coaches hovering on water looks bad, I think achieving that might be possible.

Someone on AoE3H forums said that in Unknown the trade route ocassionally places on water in parts and the stage coach just goes through the water.

In the screen shot on Facebook, Tahattus appeared to just put the trade route litterally IN the water, and the caravel just functioned like a travois normally does. In the screen shot on Facebook you see the trade route white line in the river going back and forth between trade sockets on alternating sides of the river.

So the only problem is changing the unit from stage coach to a ship.

I think it would be good to have:
travois > canoe
stage coach > caravel
train > steam boat


For my initial tests, I will go with a caravel.

So I made these changes to caravel in proto:

<Unit id ='43572' name ='CaravelTradeRoute'>
<DBID>43572</DBID>
<DisplayNameID>43573</DisplayNameID>
<EditorNameID>43572</EditorNameID>
<ObstructionRadiusX>2.9900</ObstructionRadiusX>
<ObstructionRadiusZ>2.9900</ObstructionRadiusZ>
<FormationCategory>Ranged</FormationCategory>
<MaxVelocity>8.5000</MaxVelocity>
<MaxRunVelocity>10.5000</MaxRunVelocity>
<MovementType>water</MovementType>
<TurnRate>1.0000</TurnRate>
<AnimFile>units\naval\caravel_ship\caravel_ship.xml</AnimFile>
<ImpactType>Wood</ImpactType>
<PhysicsInfo>house</PhysicsInfo>
<Icon>units\naval\caravel_ship\caravel_ship_icon</Icon>
<PortraitIcon>units\naval\caravel_ship\caravel_ship_portrait</PortraitIcon>
<RolloverTextID>43574</RolloverTextID>
<ShortRolloverTextID>43573</ShortRolloverTextID>
<ShortRolloverTextID>43573</ShortRolloverTextID>
<InitialHitpoints>240.0000</InitialHitpoints>
<MaxHitpoints>240.0000</MaxHitpoints>
<LOS>15.0000</LOS>
<MinimapColor red ='0.0000' blue ='0.0000' green ='0.0000'></MinimapColor>
<Armor type ='Ranged' value ='0.1000'></Armor>
<UnitType>LogicalTypeHealed</UnitType>
<UnitType>LogicalTypeHandUnitsAutoAttack</UnitType>
<UnitType>LogicalTypeGarrisonInShips</UnitType>
<UnitType>LogicalTypeRangedUnitsAutoAttack</UnitType>
<UnitType>LogicalTypeVillagersAttack</UnitType>
<UnitType>LogicalTypeHandUnitsAttack</UnitType>
<UnitType>LogicalTypeRangedUnitsAttack</UnitType>
<UnitType>LogicalTypeShipsAndBuildings</UnitType>
<UnitType>AbstractWarShip</UnitType>
<UnitType>AbstractFishingBoat</UnitType>
<UnitType>Ship</UnitType>
<UnitType>HasBountyValue</UnitType>
<UnitType>Unit</UnitType>
<UnitType>UnitClass</UnitType>
<UnitType>RailroadUnit</UnitType>
<UnitType>Unattackable</UnitType>
<Flag>NoHPBar</Flag>
<Flag>Invulnerable</Flag>
<Flag>InvulnerableIfGaia</Flag>
<Flag>NoProjectileDamage</Flag>
<Flag>NonCollideable</Flag>
<Flag>OrientUnitWithGround</Flag>
<Flag>NonAutoFormedUnit</Flag>
<Flag>Tracked</Flag>
<Flag>TieToWaterSurface</Flag>
<Flag>NavalUnit</Flag>
<Flag>ForceToGaia</Flag>
<Command page ='10' column ='0'>Delete</Command>
</Unit>

How the trade caravel looks in scenario editor:




Notice the trade sockets but no trade route.

I don't know how to place trade routes in the scenario editor, only in RMS.

Notice the GAIA flag, and trust me that it is unattackable. I tried to attack it with another ship and I couldn't attack it. It can't attack other ships either when I tried.

Notice the black mini map dot for the trade caravel. Giving RGB values of 0.00000, 0.00000, 0.00000 just gives you black, the color of all trade route units.




EDIT: A crash course in scenario editing and now I do now how to play trade routes in scenario editor.

The trade unit does indeed go underwater!



And grant XP! (the XP ui isn't shown in screen shots for my ui settings on my laptop at minimum settings for ui)


Mummy zombies on the Nile map is actually more historically accurate than tanks being destroyed by pikemen.

Want denser forests and a huge Amazon?

[This message has been edited by dietermoreno (edited 08-20-2014 @ 02:01 AM).]

Pikerush21
Skirmisher
posted 08-20-14 06:09 AM EDT (US)     722 / 735       
Can you please help me find the error?
The error is somewhere here:
You're adding waypoints to a trade route that wasn't created.

int tradeRouteID = rmCreateTradeRoute();

And there's no association between the sockets you defined and the trade route (which you didn't create ^^).

mSetObjectDefTradeRouteID(socketID, tradeRouteID);
dietermoreno
Skirmisher
posted 08-20-14 01:22 PM EDT (US)     723 / 735       
Thank you! No more initialization failed! (but there is still a problem that shows up.)
You're adding waypoints to a trade route that wasn't created.

int tradeRouteID = rmCreateTradeRoute();

And there's no association between the sockets you defined and the trade route (which you didn't create ^^).

mSetObjectDefTradeRouteID(socketID, tradeRouteID);
So I made the script:

//****************************WATER TRADE ROUTE*************************************************************************************************

//Reference of location from Great Lakes ice sheet to know where the water is.
//rmSetAreaLocation(IceArea1ID, 0.45, 0.50);


int tradeRouteID = rmCreateTradeRoute();
//Always put this FIRST in the trade route section of the script or else initialization failed!
//You can't add waypoints to a trade route that doesn't exist.
//Yes the computer really is this stupid that you need to tell it EVERYTHING!

int socketID=rmCreateObjectDef("sockets to dock Trade Posts");
//Always put this SECOND in the trade route section of the script or else initialization failed!
//You can't call to a variable without defining it first, in C++ like languages.
//Next we need this variable because there's no association between the sockets you defined and the trade route
//(which you didn't create ^^ if you didn't put the FIRST line of code for a trade route).

rmSetObjectDefTradeRouteID(socketID, tradeRouteID);
//The game needs to know that we want to associate these sockets
//below with the trade route.
//Why is this needed? For multiple trade routes on the same map.
//We need to call to the socket ID variable to associate it with a trade route ID variable.
//You could have tradeRouteID3 if we had 3 trade routes, but if there's only one its just "tradeRouteID".

rmAddObjectDefItem(socketID, "SocketTradeRoute", 1, 0.0);
//Always put this FOURTH in the trade route section of the script or else initialization failed!
//We need to call to the socket ID variable to associate it with building a socket trade route.

//Sets the constraints and min/max distances for placing a socket at the defined socket location.
//Min/max distance is good so the socket doesn't try to place on water or on a cliff (and fail).
//Constraint is needed so the socket doesn't place on the trade route!
//Yes the computer really is this stupid that you need to tell it EVERYTHING!
rmSetObjectDefAllowOverlap(socketID, true);
rmSetObjectDefMinDistance(socketID, 0.0);
rmSetObjectDefMaxDistance(socketID, 6.0);
rmAddObjectDefConstraint(socketID, shortAvoidTradeRoute);

rmAddRandomTradeRouteWaypoints(tradeRouteID, 0.08, 0.55, 2, 3); // -12
//Across the lake from the other waypoint.
rmAddRandomTradeRouteWaypoints(tradeRouteID, 0.86, 0.68, 2, 3);
//Only 2 waypoints in this experiment.

//rmEchoError
bool placedTradeRoute = rmBuildTradeRoute(tradeRouteID, "dirt");
if(placedTradeRoute == false)
rmEchoError("Failed to place trade route #1");

//Put waypoints same place as sockets.

rmPlaceObjectDefAtLoc(socketID, 0, 0.86, 0.68); //-5
rmPlaceObjectDefAtLoc(socketID, 0, 0.08, 0.55); //-12

//Text
rmSetStatusText("",0.30);
//Water trade route placed.
//If the progress bar moved 3 times before crashing, the error is after the water trade route placed.
//Comment off the water trade route to debug.


The problem is, the sockets place but the trade route doesn't place.

Did it fail to place because the town centers are in the way because the map is too small?






I increased the map size by 4 time to 1200, 1200.

Still no trade route.





I tried changing the elevation to Large Great Plains parameters and that didn't make the trade route place.


I increased the map size to 2400, 2400 and "You abandon your colony" error occured.


What is the error?

Mummy zombies on the Nile map is actually more historically accurate than tanks being destroyed by pikemen.

Want denser forests and a huge Amazon?

[This message has been edited by dietermoreno (edited 08-20-2014 @ 02:05 PM).]

Pikerush21
Skirmisher
posted 08-20-14 03:01 PM EDT (US)     724 / 735       
A trade route needs at least one fixed (non-random) waypoint to place on the map. Example:

rmAddTradeRouteWaypoint(tradeRouteID, 0.0, 0.6);


Then add random ones, if you like.

[This message has been edited by Pikerush21 (edited 08-20-2014 @ 03:03 PM).]

dietermoreno
Skirmisher
posted 08-20-14 03:42 PM EDT (US)     725 / 735       
A trade route needs at least one fixed (non-random) waypoint to place on the map. Example:

rmAddTradeRouteWaypoint(tradeRouteID, 0.0, 0.6);


Then add random ones, if you like.
I tried:

rmAddRandomTradeRouteWaypoints(tradeRouteID, 0.08, 0.55);
rmAddRandomTradeRouteWaypoints(tradeRouteID, 0.86, 0.68);
and the route didn't place.

So the reason it didn't place is because i was using the wrong function! I need to use "rmAddTradeRouteWaypoint(tradeRouteID, float X, float Z);".


So I try:

rmAddTradeRouteWaypoint(tradeRouteID, 0.08, 0.55);
rmAddTradeRouteWaypoint(tradeRouteID, 0.86, 0.68);


Success:

The hilariousness of a travois traveling underwater and emerging from beneath a fishing boat.



I guess we can call that a success for "the simplest water trade route".

It really is as simple as possible so I didn't write any coherence or influence points for the lake so the lake just goes everywhere in the map and sometimes tc's don't place (but they usually place.)

No resources either, because it is as simple as possible.

The next step would be to find how to change the trade units from travois to my trade caravel.

I'll upload this map and the trade caravel files and maybe someone will figure out how to change the trade units.

Mummy zombies on the Nile map is actually more historically accurate than tanks being destroyed by pikemen.

Want denser forests and a huge Amazon?

[This message has been edited by dietermoreno (edited 08-20-2014 @ 04:36 PM).]

« Previous Page  1 ··· 10 ··· 20 ··· 27 28 29 30  Next Page »
You must be logged in to post messages.
Please login or register

Hop to:    

Age of Empires III Heaven | HeavenGames