• 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

Strange Building behaviour

Started by stinky, March 08, 2004, 05:11:58 AM

Previous topic - Next topic

stinky

Throughout playing bz2, I have noticed on some occasions this bug when choosing a place for my building the ground is green for OK, red or yellow for unbuildable places. I was playing that bz2 mission where you are dropped into an overrun ISDF base. Can't remember what it was called but I was hoping that 1.3 would've fixed the issue where the ground was green, however trying to place a building there - it would show up red and the constructor would say he can't do it, although it is clear that the building can go there no probs.....any comments?

AlbinoPenguin

I would have to test this, but it is because of the following if I recall correctly.

BZ2 will let a building be built on a slightly non-level surface, make the terrain completely flat, and hence changing the terrain slightly

say this is your terrain: (with '|' being a mark to show you the tile breakup)

  (1)            (2)             (3)
           
----_____|_____------|-------------

Now lets build a power Gen on the first tile. We get the terrain as follows:

  (1)            (2)             (3)
[Power]          
_________|_____------|-------------


Notice it flatten the terrain to fit the power in.
Note aswell, that NO terrain changes can happen on tile 1 whlie the Power Gen is there.

Lets build a relay on tile 3 now

  (1)            (2)             (3)
[Power]                      [Relay]
_________|_____------|-------------

It didn't change the terrain since it was already flat, and didn't need to.

BUT! Here is the problem. the bz2 engine believes that tile 2 is flat enough to build on it, which it is. HOWEVER, no terrain can be changed on either tile 1 or 3 since buildings are there. Hence, when you tell the builder to build on that square, it tries to work out how to flatten the tile out to place the building on it, while keeping the terrain continuous, which obviously can't be done.

Atleast, thats how I worked out what was happening. I could be wrong, and hopefully some either Ken or GSH can correct me if I am wrong if they are around.

I also have a potential solution aswell. After thinking about it, it wouldn't be the *easiest* to implement, but would work the majority of times if done correctly.

When building on a terrain square where what height it is flattened to doesn't depend on an adjacent building, maybe the engine could do  search on tile edge heights, and work out what height it should be made to keep it the same level as the other tiles of similar height in the area. Maybe precalc this sort of data during game load, then just read of it during game. I know its a VERY vague discription, but its hard to do without code infront of me. Hopefully you get the idea though

appel

Yes, I've noticed this problem also on some maps. But in most MP this isn't a problem.

If you're moving your constructor out to build gun towers at a location that has enough green area, and finally when you build that relay bunker all the area becomes red and your strategy is screwed :) 90 scrap down the drain.

PhoeniX-FlamE

i found that 2 green squares jason to each other and once u build in one a relay u cant build on the 2nd one...

also for some reason u cant build buildings like power and bay near pools which is extremly annoying

Kalpa

They can be built next to the pools IF the terrain height on the rest of the BUILDINGS is the same than at the pool. All buildings have flat floor. This floor must be on same height with any adjancent buildings, and yes, pools are 'buildings' in this sense too. So if your base starts out at even 1 unit difference in height than a pool somewhere else, there will be always at least one structure-square gap somewhere between your base and the pool. This is why map makers should be careful to put those base pools to same height than the ground height of where recycler will probably be deployed if they intend to have any structures adjanced to the pool.

The reason for this is that if the buildings are even slightly at different heights you can see into the 'void' from the gap. Try it out with the editor, you'll see what I mean. Someone with any technical expertise on the game engine could probably explain the exact reasons more specifically, but with my simple logic, between two adjanced buildings of different heights there is a piece of ground with a width of 0 and height increase of something... probably something evil takes place then ;)

(As you know, complete 90 degree wall is impossible with the terrain engine. Even more speculations: I think the terrain engine just uses height values for certain points and draws polygons between them. Thus one point in game cannot have two height values at the same time, probably leading to what described before)

What comes to some ground appearing 'green' and after construction another green square of for example 2 squares disappears, well, there is some value that constructors can change terrain height in order to build stuff. If the construction to the other green area changes the height so much that the other green square will go out of the range in which constructor can shape the ground, then it cannot be built on any more. At least in 1.2 you could actually do a bit miss-or-hit at what height you wanted the building constructed by just pointing at ground, I think it constructs the building at that height you are targetting. I believe you can in most cases preserve the another green tile too, if you paint the ground just near the edge of those two green squares, thus causing the building to be constructed relatively close to the another green square's height.

Ahem, that wasn't exactly 'clear' but go and experiment and you'll probably understand what I mean. :)

PhoeniX-FlamE

thats make alot of senses, thx

but 1 question.. in chill it looks exactly same level...
try to put the fac or other building clsoe to the pool in chill.. it realy looks the same level :s

maybe we could fix that in the stock maps?

Kalpa

Quote from: PhoeniX-FlamEthats make alot of senses, thx

but 1 question.. in chill it looks exactly same level...
try to put the fac or other building clsoe to the pool in chill.. it realy looks the same level :s

maybe we could fix that in the stock maps?

Well, the pool's height on the other side is 1996 and the rest of the base area is 1999/2000. On the other base area the pool is at 1999 and rest of the base 1999/2000. Notably the area near the spawn points is mostly 2000, so that's the height your main base would probably get built on.

You're right, it doesn't even show (expect maybe as occasional pixels when reaaallly close), but it's enough that stuff can't be built between pool and base. You could, of course, deploy recycler adjancent to pool, taking extra 10-20 seconds for the recycler to traverse the distance, and like we know, it can make all the difference in a strat game, let alone talking of recycler right next to that rift for hungry enemy scouts... ;)

Makes me think whether author wanted to have it so that nothing can be built next to the pool or is it just a very simple thing gone wrong... :)

Kalpa

Okay, humm, I'm puzzled. I just managed to do something I though the game engine would not allow to do, I managed to deploy a recycler just next to that 1996 pool. The recycler is at height 1998 and it creates that ugly 'void' when looked at correctly (after that I deployed a scav at the pool to see whether it would make extractor at 1996 or 1998, it did it by the pool (1996) just as I had expected it to). I had thought the recycler would just smooth itself to 1996, but it didn't. Learn something new every day, huh.



If the image doesn't show, then blame my ISP. It's pretty random when it shows 404 and when it doesn't, and no, I don't know any reason for it :P

Anyway if the whole base area would be clearly at 2000 without any silly 1999 drops then none of this would be happening... I think :)[/img]

PhoeniX-FlamE

yes, ive tried that before... its same on some other maps... i think mission maps.. the one after you get in the teleport.. i sent my rec to the farer pool... then one thats suposed to be your 2nd... if im not mistaken it wasnt the same level as the pool and it looked like the pic you just put here...

not exactly sure if was that map but i have seen that happends before