Light Style© by Fisana

Jump to content


Photo

Wall build tool for RMGs


  • Please log in to reply
53 replies to this topic

#21 FeXoR

FeXoR

    Centurio

  • Community Members
  • PipPipPipPipPip
  • 925 posts

Posted 09 March 2012 - 01:07 AM

I wouldn't say it's a good idea to work around issues with the models by changing the code, better to do it right in code the first time and fix the models.


I agree perfectly, that's where the default fortresses of the different sizes come in. That should be default later.
I only added civ specific default fortresses differing from one another to get about the same size, same firepower and same upkeep for all civs (well, not romans ^^)

If you only have walls and towers it's boring. Test the wall_demo map to see what is possible and allrdy working!

Edited by FeXoR, 09 March 2012 - 01:09 AM.

  • 0

#22 FeXoR

FeXoR

    Centurio

  • Community Members
  • PipPipPipPipPip
  • 925 posts

Posted 09 March 2012 - 01:24 AM

Nice work Fexor, that is great. Neat shapes :) How do the scripts do if you ran it on a map that wasn't flat?

Works fine for descent hills. Some things look strange though (celtic wall towers for example):

fortresses_with_hills.jpg

Oh, and celtic walls can fly! :LOL:

celtic_flying_wall.jpg

Edited by FeXoR, 09 March 2012 - 01:28 AM.

  • 0

#23 feneur

feneur

    Cartographer of imaginary worlds

  • 0 A.D. Project Leader
  • 7,777 posts

Posted 09 March 2012 - 01:51 AM

Oh, and celtic walls can fly! :LOL:

Yeah, the Celtic walls will be remodeled :)
  • 0

Erik Johansson [ aka feneur ]

Wildfire Games
Contact me: feneur@wildfiregames.com



Support Wildfire Games!


#24 FeXoR

FeXoR

    Centurio

  • Community Members
  • PipPipPipPipPip
  • 925 posts

Posted 09 March 2012 - 01:54 AM

darn! Forgot the out of memory issue caused by mass trees.
Here's a fixed version:

Attached File  fortresses_v0.2_and_wall_demo.zip   10.18KB   39 downloads

Edited by FeXoR, 09 March 2012 - 02:00 AM.

  • 0

#25 FeXoR

FeXoR

    Centurio

  • Community Members
  • PipPipPipPipPip
  • 925 posts

Posted 09 March 2012 - 01:57 AM

Yeah, the Celtic walls will be remodeled :)

Oh, I like it. Though it caused me about 2 hours to get a fitting right angle without the ramp of the next walls are seen outside the castles...



  • 0

#26 historic_bruno

historic_bruno

    Primus Pilus

  • WFG Programming Team
  • 2,388 posts

Posted 09 March 2012 - 02:30 AM

Works fine for descent hills. Some things look strange though (celtic wall towers for example):

One solution for that might be allowing map entities to conform to the terrain slope and/or specify their height. The map format doesn't support either yet :( Walls will probably need those changes to look good on hills, though your examples don't look bad really.
  • 0
Ben Brian [ aka historic_bruno ]

Wildfire Games Programmer
Contact me: ben [at] wildfiregames [dot] com

#27 FeXoR

FeXoR

    Centurio

  • Community Members
  • PipPipPipPipPip
  • 925 posts

Posted 09 March 2012 - 03:05 AM

One solution for that might be allowing map entities to conform to the terrain slope and/or specify their height. The map format doesn't support either yet :( Walls will probably need those changes to look good on hills, though your examples don't look bad really.


I think it looks fine, as I said before.
Of cause it would be really nice if walls whould bend themselves to the ground, but...
That would be the first game I know that supports such features.

Imo the priority for that is very low.
A worse problem is the garrisoning of units in wall towers.
I expect them to leave divided inside and outside the fortress when 5 units are ungarrisoned, though this could be handled with the check of the nearest passable tiles next to the exit/entrance/drop-point (whatever).
I don't play much yet, because the AIs pile up there peasants in my version and desperately await the alpha9.
The gametest will have some surprises in it's bags I guess ^^
Well, who doesn't like surprises?!
  • 0

#28 FeXoR

FeXoR

    Centurio

  • Community Members
  • PipPipPipPipPip
  • 925 posts

Posted 09 March 2012 - 12:35 PM

One solution for that might be allowing map entities to conform to the terrain slope and/or specify their height.


That would look bad as any architect uses plumbs to get an accurate vertical lineup.
In addition to conform to the terrain slope the wall elements then need to be distorted to shape like an parallelogram in order to fit better to the ground and still remain it's vertical lineup.

Similar measures have to be made if the wall bends to the terrain curvature (Like the Great Wall of China does).
  • 0

#29 FeXoR

FeXoR

    Centurio

  • Community Members
  • PipPipPipPipPip
  • 925 posts

Posted 09 March 2012 - 05:02 PM

Next and for now final version of the wall_builder rmgen script.

It works like I had in mind and doesn't fail if an unknown civ should be placed.
Attached File  wall_builder_pack.zip   10.41KB   37 downloads
Included files:
- wall_builder.js: A rmgen script for wall placing. It's inside the rmgen folder where it belongs inside the 'random' directory.
- fortresses.js/json: A simple playtest random map with fortresses added for each player of the corresponding type and style.
- wall_demo.js/json: A demo map to show the different default fortress sizes and their shapes. Documentation in the map description.
- A text file to help figuring out where to put the files.

Here's a screenshot of a small map with 6 players:
fortresses_6players_small.jpg
The players civs are clockwise carthaginiens, celts, hellenes, iberians, persians and romans.
Since I use the alpha8 romans are not defined. So the script warns and falls back to the palisade fortress for unknown civs.

I added some hills so the effect to the fortresses can be seen without making it unplayable.
The fortresses add 20 population bonus each. The reason can be read in above posts. I don't think it's that tragic.

To add those civ dependent default fortresses to a random map, just add the following code:
// Place fortresses
var civ = g_MapSettings.PlayerData[i].Civ;
var fort = new wallTool(civ);
fort.setFortress(civ);
fort.place(baseX, baseZ, i+1, BUILDING_ANGlE);
With:
- 'i' the player number starting from 0 for the 1st player (with default color blue) and so on
(In 'fort.place' it's i+1 because 'gaia' is 0 for template placement and 1 is the 1st player)
- 'baseX' and 'baseZ' the x and z coordinates of the players civil center the fortress should include
- 'BUILDING_ANGlE' the orientation of the fortress. (As far as I know the default name for the global orientation for buildings)

To add customized walls it's still the same mechanism as in the opening post.

Feel free to play around with it. ;)

Edited by FeXoR, 09 March 2012 - 05:29 PM.

  • 0

#30 FeXoR

FeXoR

    Centurio

  • Community Members
  • PipPipPipPipPip
  • 925 posts

Posted 12 March 2012 - 06:21 PM

Here's an update for svn version 11321.

Added Rome and changed 'watch-tower' to 'defense_tower' in code and some outer watch towers to outposts.


Attached File  wall_builder_pack2012-3-12.zip   10.4KB   38 downloads

Here's a screen-shot of the fortresses map.

fortresses-6players-medium.jpg


Fences and roman siege walls yet to come...


  • 0

#31 Wijitmaker

Wijitmaker

    0 A.D. Old Timer

  • WFG Retired
  • 9,538 posts

Posted 14 March 2012 - 01:22 PM

Nice work Fexor!
  • 0

Jason Bishop [ aka Wijitmaker ]

0 A.D. Founder

Contact me: jason@wildfiregames.com


#32 Pureon

Pureon

    Primus Pilus

  • 0 A.D. Art Team
  • 3,572 posts

Posted 15 March 2012 - 12:03 AM

This is looking and working really well FeXoR. Great stuff (y)
  • 1

Pureon
0 A.D. Part time Designer / Texturer / 3D Artist
Contact email:
pureon{@}wildfiregames.com


#33 FeXoR

FeXoR

    Centurio

  • Community Members
  • PipPipPipPipPip
  • 925 posts

Posted 15 March 2012 - 08:21 AM

New version with wall tower's 'drop points' inside the fortress.
This version no longer grants starting resources (I don't think mines/trees/bushes inside fortresses are realistic).
I will add food supplies like chicken in later versions though.
Attached File  wall_builder_pack2012-3-15.zip   10.73KB   37 downloads
fortresses-6players-medium.jpg

IMO iber walls, wall towers and wall gates have to be remodeled. This would enable the usage of wall towers instead of defense towers and so avoid the upkeep gain.
If celt walls/wall towers would be redone also that would make civ specific fortress types unnecessary.
ToDo:
- Add 'cornerInHalf' and 'cornerOutHalf' wall element types with bending of PI/4 (45). (Especially for celt gates to look better.)
- Add 'placeWallToTarget' capability.
- Add circular wall capability.
- Add 'romanSiege' style.
- Add 'fence' style.
- Add 'road' style.

This is looking and working really well FeXoR. Great stuff (y)


Thanks! And to you Wijitmaker :thank_you2:

Edited by FeXoR, 15 March 2012 - 01:10 PM.

  • 0

#34 feneur

feneur

    Cartographer of imaginary worlds

  • 0 A.D. Project Leader
  • 7,777 posts

Posted 15 March 2012 - 09:22 PM

IMO iber walls, wall towers and wall gates have to be remodeled. This would enable the usage of wall towers instead of defense towers and so avoid the upkeep gain.
If celt walls/wall towers would be redone also that would make civ specific fortress types unnecessary.

Walls are very likely to get an overhaul in the next couple of months for implementing a wall building system for the user. It's good that you offer your input from the RMS point of view though, so all things are taken into consideration (y)
  • 1

Erik Johansson [ aka feneur ]

Wildfire Games
Contact me: feneur@wildfiregames.com



Support Wildfire Games!


#35 FeXoR

FeXoR

    Centurio

  • Community Members
  • PipPipPipPipPip
  • 925 posts

Posted 18 March 2012 - 06:00 PM

Here's a new version to keep compatible with the SVN version.
WARNING: The rmgen folder is mainly for people using alpha9. If you are using the SVN version use it with care!
Attached File  wall_pack2012-3-18.zip   10.9KB   42 downloads
  • 1

#36 MishFTW

MishFTW

    Primus Pilus

  • Web Development Team
  • 1,918 posts

Posted 26 March 2012 - 03:50 PM

Thanks for helping me kickstart my city :D
  • 0
Mish [Adarash Mishra]
Wildfire Games Webmaster
Email Me | About Me

#37 FeXoR

FeXoR

    Centurio

  • Community Members
  • PipPipPipPipPip
  • 925 posts

Posted 28 March 2012 - 01:34 PM

and the roman palisade too, please.


Now we Mencionated the defense of a City, why dont implement system of tramps like the series of Sparta Ancient Wars , Fate of Hellas etc.

Check the min 1:03- 1:05
http://www.youtube.com/watch?v=D6OUlubuDJw


You mean the 'normal' wall, the siege wall or the non-civ-specific palisades? Romans in the wall tool has the normal wall that is quite the same as for carthagians, helenes and persians.


I don't really know what you mean by 'system of tramps'. Falling debris damaging the units around? I should improve my english x)


  • 0

#38 Mythos_Ruler

Mythos_Ruler

    Senator

  • WFG Retired
  • 14,965 posts

Posted 28 March 2012 - 06:58 PM

The Romans used these in their siege of the Gallic town of Alesia. That must have been brutal.
  • 0

#39 Mythos_Ruler

Mythos_Ruler

    Senator

  • WFG Retired
  • 14,965 posts

Posted 28 March 2012 - 08:18 PM

BTW -- your UI link is broken.
  • 0

#40 FeXoR

FeXoR

    Centurio

  • Community Members
  • PipPipPipPipPip
  • 925 posts

Posted 09 April 2012 - 04:11 PM

After a total rewrite and many changes a screen-shot of the new wall_demo random map that should provide code examples of how to use wall_builder.js rmgen.

Changes:

- Added easy to use placeLinearWall(startX, startY, targetX, targetY) function. It can be set more accurate by optional arguments (wallPart, style, playerId, endWithFirst).

- Added easy to use placeCircularWall(centerX, centerY, radius) function. It can be set more accurate by optional arguments (wallPart, style, playerId, orientation, maxAngle, angleOff).

- Set everything up to the changed random map object placement.

- Adjusted celtic and iberian walls.

- Removed the wallTool class that held all the information. That means some functions take more arguments but most of them are optional.

- Added and rewrote documentation.

- Wrote a wall_demo random map as a code example for most cases the wall tool will likely be used.

wall_demo.jpg



  • 0