• Welcome to Battlezone Universe.
 

News:

Welcome to the BZU Archive dated December 24, 2009. Topics and posts are in read-only mode. Those with accounts will be able to login and browse anything the account had access granted to at the time. No changes to permissions will be made to be given access to particular content. If you have any questions, please reach out to squirrelof09/Rapazzini.

Main Menu

AI Base

Started by Red Devil, March 02, 2004, 10:57:29 AM

Previous topic - Next topic

Fishbone

eddeighton: dont use build and drop off via dll. use aip files to build the base.
it is very easy to set up an aip file that builds (and rebuilds) the whole base. you just have to make sure all requirements are always fullfilled.
using the dll to do this is a nightmare!

OvermindDL1

Yes, using the dll to build it would be next to impossible because you would have to scan the base terrain seeing what is flat and what is not, figure what to build, have to move the units around yourself in dll, etc... etc...  Would not be an easy task at all.

eddeighton

I feel happy doing it in the dll I havn't actually even looked at a single AIP file yet - I just assumed they were kinda crud given the tiny bases all the IA maps generate that come with bz2  - I must say the IA maps I have since downloaded have been better.  I got the AIP edittor so I will look into it but I probably will leave it for unit construction stuff.

I dont fancy making zillions of path points in the bz edittor either.  I havn't actually messed with the AIPath routines yet but it looks trivial enough - only thing I dont see is how to set the orientation of a structure but its probably determined by the angle you move the constructor towards the location.

My system works with a predefined base layout which once in game the constructors will build an maintain - the base layout has to work with the land basically which is down to the map maker.

I need to do it anyway because my mod needs the players side to also be able to automatically build bases with only initial configuration by the player, I have already had a basic test system working while figuring out the ins and outs of the dll - great fun.  It works perfect with the priority settings i.e. the user can countermand a constructors current command - then later then constructor may ask the player if it can demolish some building thats in the way,, :)

Its not hard just aslong as the track all the buildings created /destroyed and have a working preset base plan.  I will leave it to someone else to try and make a dynamicly designed based lol!  

Ed.

Fishbone

hmm, also for this task, aips are much easier.
if you have an active aip on the players team, you can share the constructor with the aip plan. has been done in a few FE missions.
preselecting a base layout would also be easy (I did mission like this way back in FE days but never released it. I would have control over several recyclers on different teams. Making this fun to play versus ai was next to impossible due to balance problems and the fact that there are so many different play-styles)
hmm, now that I know more about MP dlls, I might come up with a new strat dll...

oh, you cant set the orientation of the buildings via aip. no big deal. just make sure you plan the base well. have the ai base situated in the south helps. stock buildings do face north.

So is your dll actually deducting scrap when your cons is building a building? It is not tough to do, but just one more thing that has to be coded that is native in aips.

Red Devil

Yeppers, that was all done with one AIP from scratch.  I did it a different way than is normally done, so it maintains everything the base.  You have to take it down in one swell foop, otherwise, you are right back where you started.
What box???

PhoeniX-FlamE

btw, 1 m-curtien tank can take the base down

NoK0mm3nt

Look on the north side of the base. PF is pointing out a very vital hole.

eddeighton

When you use the build and dropoff commands from a dll the constructor still goes through the same motions either failing to build because of an invalid building or location or building the thing and deducting scrap.

<edit>
Using the basic commands means that you can only use predefined paths and I dont think there is any way to convert an AiPath to a path name.  In my system i have a path point for every base square within the base building area - which is frustrating to setup but could be done by programatically modifying the bzn file (probably what I will do eventually).

The direction the constructor moves to the build path or extra points on the build path have no effect on the built structures orientation (from what i have seen in tests) - looks like my AI bases will have all buildings in same direction :( - unless I manually sneak change them when the player is not looking?

I havn't actually tried doing it the hard way, i.e. triggering the constructor anims, spawning the unit with a build effect and deducting scrap and so on.  This may be a better route but would mean bypassing all the things teh build and dropoff commands cause - probably a lot of system checks and stuff
</edit>

I noticed that one of the cool things about the DLL is that if objects are saved on the map, when the map loads those objects are still added through the addObject dll routine - so you can reliably track all objects.

<edit>
This is not completely true - somethings are not detected at startup and somethings are not notified upon removal but you can get away with it with some hacking,,</edit>

This means it would be possible to lay out a huge base in the edittor.  Then the dll would read in the base and remove the objects.  The dll would then have an exact pre-specified base plan to go about building and maintaining - this is how I think BZ2 should have originally worked - i.e. somehow every structure could have a flag set to specify whether the AI is supposed to build it or if it just exists from the start.

One thing I havn't figured out yet is how to give a side scrap resources when the side has no recycler / scavengers / silo type buildings.  

In the dll you cant modify the scrap levels to levels which conflict with the players actual scrap containment capabilities.  I think it would make sense if a tug could somehow carry a scrap cargo - any ideas would be great thanks.



Ed.

Fishbone

I am not quite sure what you want to do.
but if you want to have a player have scrap to feed a constructor you will have to give him a silo type building.
this building can be off map. I use a similar trick for DuneCommand where the construction yard (think Dune2 now) is in the armory slot but I still need to be able to store inital scrap for the beginning of the game. an invisible extractor type building does the trick.
When you want to change the game play you really have to become creative and use what bz2 offers in new ways. There is a workaround for almost everything :)