Home » SIRTECH CLASSICS » Jagged Alliance 2 » JA2 Technical Department » Interlocking JSD structures
Interlocking JSD structures[message #270941] Sat, 22 January 2011 02:24 Go to next message
Hawkeye

 
Messages:1800
Registered:October 2005
Location: Australia
Can anyone advise me in regard to JSD structures whether two structures can interlock within structure system.

I am working on a large fuel tanker truck, currently consisting of three frames, one for the front cab, and then two frames for the trailer tank which due to it's size has been divided in two to draw quicker in game. So far the sti's connect together well, but I am facing a problem when it comes to the JSD's structure blocks.

So far my front cab has a low row of structures where it connects to the trailer, while the connecting end of the trailer has a high row to avoid any clashes to the cab. What I want to achieve is a tight connection of the two frames as well as have the flexibility of using the trailers and cabs individually if I wish, but despite plenty of space between the two, the map editor will not let me 'overlap' these two elements when connecting.

Here are my two basic structures pictured below in the Pipetz's editor, (please ignore some of the 'crazy paving' blocks on the trailer, that's just for me to see the separation of rows easier.) Does the JSD format not allow overlapping structures such as this, even if there is no clash within the structure blocks themselves? Or would my offsets be incorrect or causing issues?

http://i199.photobucket.com/albums/aa9/collector_hawkes/Locking_cab.gif
http://i199.photobucket.com/albums/aa9/collector_hawkes/Locking_tanker.gif


I took Sir Tech's original Helicop.sti and JSD's as a pointer, but I do notice the overlapping prop hub of the helicopter sits withing the 'on roof' block level, while the copters main body all sits underneath this row. Again, will the game simply not allow two objects to use common levels? Even if no structure blocks are there to clash?


Re: Interlocking JSD structures[message #271736] Sat, 29 January 2011 08:14 Go to previous messageGo to next message
Hawkeye

 
Messages:1800
Registered:October 2005
Location: Australia
After a lack of response here, I ventured on, and with a few suggestions from others outside of the forum have reached this point...

http://i199.photobucket.com/albums/aa9/collector_hawkes/SCREEN_Razorgoes_truckin.jpg

It was suggested JSD structures or blocks could collide if you made one of the groups 'passable.' What I did was make the rear of the tractor/truck cab passable, allowing some overlap of the tanker trailer, but making it passable and effectively removing any collision with the player, just made the rear of the cab appear like a backlot painting rather than a solid, real-life object. This in effect worked geometrically, but visually in game it just looked wrong.

Since then I've gone the Sir-Tech Helicopter route and just moved the front trailer structures 'on roof' which do not clash with the trucks structures at all. The front cab still retains it's structure and collision properties preventing the player from walking right through the back of the cab, or front of the trailer. The visual results are also better, but I'm still not pleased with the stippled overlay effect of the cab behind. So now I need to find how I can somehow lose that stippling or work out if there is some way of sorting graphics so that the trailer overlays on top of the cab and not the other way around.


Re: Interlocking JSD structures[message #272110] Wed, 02 February 2011 08:55 Go to previous messageGo to next message
Hawkeye

 
Messages:1800
Registered:October 2005
Location: Australia
Another week another problem. :wb:

Since being unable to make these frames sort correctly or lose the stippling effect I have noticed even more strangeness. When the trailer is placed on the map on it's own, with no overlapping elements nearby I get a strange redraw error, as you can see the weirdness seems contained to a very clean cut, tile shaped area. This area shifts and swims, seemingly unable to paint or refresh that shadowy area at the front of the trailer.

http://i199.photobucket.com/albums/aa9/collector_hawkes/Weird_redraw.jpg

Is anyone aware of limitations with using shadows? To me it appears they can only work as far as around 7 tiles long (0 to -6 in X seem to be it's limit.)

Anyone? :blueface:


Re: Interlocking JSD structures[message #272169] Wed, 02 February 2011 16:58 Go to previous messageGo to next message
Anonymous
@Hawkeye

Go ask The Scorpion.
He usually hangs out in Here.
Re: Interlocking JSD structures[message #272226] Wed, 02 February 2011 23:01 Go to previous messageGo to next message
Hawkeye

 
Messages:1800
Registered:October 2005
Location: Australia
Thanks Tao, I have been in touch with Scorp' quite a bit lately, but this issue has still stumped both of us so far.


Re: Interlocking JSD structures[message #272276] Thu, 03 February 2011 05:54 Go to previous messageGo to next message
Anonymous
Hawkeye
Thanks Tao, I have been in touch with Scorp' quite a bit lately, but this issue has still stumped both of us so far.


:dontknow2:

Time to break new ground and innovate.
Re: Interlocking JSD structures[message #272284] Thu, 03 February 2011 06:28 Go to previous messageGo to next message
Hawkeye

 
Messages:1800
Registered:October 2005
Location: Australia
Hmm yeah, got further today, lost swimming weird effect at one end of the shadow by moving the offset and corresponding JSD blocks. :rulez:

But then I discover when walking around the back that the merc appears to float over the truck sprite, despite JSD blocks being there as they should. Front of half of the tank works, but not the back half.

Right now I'm questioning your 'The Journey is the reward' line :roulette:


Re: Interlocking JSD structures[message #272285] Thu, 03 February 2011 06:38 Go to previous messageGo to next message
Anonymous
This is the best part.
Enjoy the present.
Re: Interlocking JSD structures[message #272296] Thu, 03 February 2011 09:23 Go to previous messageGo to next message
Hawkeye

 
Messages:1800
Registered:October 2005
Location: Australia
I was going so well today, sliding my JSD's and compensating the offset, slowly getting rid of the weird shadow problem. Then just as I thought everything was great I noticed when walking around the back of the tanker (behind it) the Merc floats in front of the sprite. I am quite close to blowing my brains out now, or kicking in my computer!

I've since gone back, tried a number of different JSD formations, turned things on and off, but to no avail. It seems any part of the truck sprite that is within the JSD tile with a positive value in X doesn't want to sort correctly, the collision is there, you can't walk into it, but the area behind stays painted on the background, with Merc walking over the top of it, not the other way around.

My observation seems to be :

1: Go too far in shifting -X and you will get weird shadow effects
2: Go too far in shifting +X and you'll get incorrect sorting

:computer2:


Re: Interlocking JSD structures[message #272299] Thu, 03 February 2011 10:06 Go to previous messageGo to next message
usrbid

 
Messages:1558
Registered:December 2008
Oh man, I feel so sorry for you, you put so much time into this and now the game doesn't work like it should, that sucks big time!! Crying or Very Sad


Re: Interlocking JSD structures[message #272505] Fri, 04 February 2011 02:11 Go to previous messageGo to next message
Hawkeye

 
Messages:1800
Registered:October 2005
Location: Australia
Yup, it's gone from vaguely fun to something closer to pulling teeth or reinventing the wheel. At least the information is out there now if someone decides they want to do something similar, as long as they manage to find this post easily enough.

Either way the trucks will go in, just might not act 100% as they should visually at the moment.


Re: Interlocking JSD structures[message #272677] Sat, 05 February 2011 05:29 Go to previous messageGo to next message
Hawkeye

 
Messages:1800
Registered:October 2005
Location: Australia
May have found a workaround, results are not 100% ideal or as visually impressive as they should be, but they do the job.

It does seem that JA's engine does not like oversized frames in an Sti, the weird results I've been butting my head against for the past week or two seem to be all related to this fact. As far as I can tell it's around 7 tiles in length is the limit, any more and you will have to compensate if you want it refreshing and redrawing correctly in game, and for shadows to work as they should. A good guideline is if using Pipetz JSD editor, the red square on the ground in the 3D view is your safe zone in some respects.

As mentioned before sorting will not work correctly if your tiles are within +X, this is also why most tiles start at X 0,0, then back track negatively. However go too far back in negative X and shadows screw up.

So to fix my issues with my large fuel tanker truck, I had to take this novel approach, thanks with helpful suggestions from The Scorpion who has been throwing ideas around, testing my efforts and helping me reach the results below.

The Tanker truck still consists of two frames, one frame for the front cab with a mask of the front of the tanker cut out of it and a larger frame for the entire tanker trailer. I'll also have a separate truck cab without the mask cut out which can be used independently, but this is not related to what's going on here right now.

The Trailer's shadow has been drawn in the Sti, but has been cropped to end somewhere around that magic 7 tiles length. Here you can see it end in an arrow head shape close to the trailers stand, and not far from where Haywire watches on with his mad-staring eyes.

http://www.mediafire.com/convkey/1520/annfg3cw35ycmddzg.jpg

What has been added since is simply some hand placed wall shadow maps in the map editor, in this case a row of five by two, to simulate shadow from the tanker, it was then just a case of painting in the missing shadow where these two connect in the Sti achieving the results below. I'll give a gold star who can spot a the main visual shortcoming, actually there's two but one is very subtle.
http://www.mediafire.com/convkey/8869/digrcd7dh1itdd1zg.jpg
So far so good, one large tanker trailer casting a half decent shadow, and working, sorting and acting in game as it should. Now time to attach it to a cab...

http://www.mediafire.com/convkey/dd46/6cnypiqmpgt3xkrzg.jpg

The cab with the mask is placed down in the map, and clashing wall shadow tiles were removed. It's not pixel perfect but damn well close, the front cab uses it's own shadow from it's S.Sti, the trailer uses it's own (cropped) one too, and the gap between is filled with more wall shadows.

Finally a quick check on JSD's and structure information. The front cab with cut out, has a shortened block structure, compensated with offset, so in effect, the rear part behind the cab and where the wheels are have no structure tiles, instead collision is used from the trailer's JSD information. This is to allow for the close connection of the two which was one of my first things I wanted to achieve when all this began.

http://www.mediafire.com/convkey/567b/ujsllw0i7acnpnmzg.jpg
Line of sight shows you some of the JSD structure, and some of the slight gaps I've added to represent the spaces under the trailer in particular. They are not perfect, ideally it would be great to crawl underneath it, at certain parts, but for now things like shooting from underneath (or shooting at enemies legs if they are stationed nearby) is possible.

All in all a huge amount of hassle to get something fairly basic working in game, it may be a good indication why Sir-Tech kept the use of larger structures to a minimum, but hopefully some of these discoveries will have been worth it.

Only thing now is to quote Austin Powers.....'Aaand I'm spent!'

[Updated on: Sun, 16 July 2017 04:38]



Re: Interlocking JSD structures[message #272698] Sat, 05 February 2011 11:58 Go to previous messageGo to next message
nollan

 
Messages:112
Registered:July 2006
Location: Le Su
Wow...I'm amazed. Have you any idea what the implications might be from your work? Besides of course a very nice looking truck! Smile
Re: Interlocking JSD structures[message #272704] Sat, 05 February 2011 12:07 Go to previous messageGo to next message
lockie

 
Messages:3928
Registered:February 2006
Location: Scotland
Lookin' good Hawkeye , lookin' good ! :ok:


Re: Interlocking JSD structures[message #272766] Sun, 06 February 2011 02:22 Go to previous messageGo to next message
Hawkeye

 
Messages:1800
Registered:October 2005
Location: Australia
nollan
Wow...I'm amazed. Have you any idea what the implications might be from your work? Besides of course a very nice looking truck! Smile


Well no huge implications, the original intention was to use intersecting elements that could be used both individually and together, making better use of the limited frames we have in a Sti/tileset. I was also hoping to get quicker redrawing graphics for such large elements also, but due to the obstacles faced I've had to settle for a compromise. I've kept a record here for those considering similar technical issues, or those wanting to produce large elmements such as this in the future.


Re: Interlocking JSD structures[message #272772] Sun, 06 February 2011 05:02 Go to previous messageGo to next message
Anonymous
What else are you working on? That is a pretty fresh idea.
Re: Interlocking JSD structures[message #272784] Sun, 06 February 2011 09:46 Go to previous messageGo to next message
Hawkeye

 
Messages:1800
Registered:October 2005
Location: Australia
I've got my hands full with Vengeance: Reloaded. Intentions are to add a few elements like this to add a bit more flavour, as well as some separation between that mod and Renegade Republik. Never was my intention to work on art, as it's a bit close to my regular/paid work, but so much for that idea!

Still plenty more to do, translation stuff, adding a bit more character to NPC and RPC's, tuning quests, producing new faces and recording speech. Hoping to give Scorp' some bits and peices when I have time too.

No rest for the wicked!


Re: Interlocking JSD structures[message #296151] Tue, 03 January 2012 07:44 Go to previous messageGo to next message
Hawkeye

 
Messages:1800
Registered:October 2005
Location: Australia
A note to myself and any others considering LARGE tiles.

Current limit reached for a tile before redraw is too slow (or 'pops') 180 high.

Current limit reached for a tile before redraw is too slow (or 'pops') around 150 wide.

I'll come back and edit these when I've discovered the breaking point in X. May well be around 180 too.

******* Edit *********
Well it seems I can't find a magic or concrete figure for maximum size in X. Some tiles I have used that are 180 still pop, yet others do not, some that are even larger do not, so there must be another factor affecting how the graphic redraws. Personally the figure that seems to work for my particular tiles is 150 wide, so that would be a safe starting point, any larger and you may (but not always) risk your graphics 'popping.'

**** Sidenote *****

This 150 wide value almost corresponds to JSD's acting weird when they are larger than 7 tiles (7 tiles would be 140 pixels wide) which has been mentioned before earlier in this thread.

[Updated on: Sat, 16 July 2016 05:14]



Re: Interlocking JSD structures[message #297415] Sun, 29 January 2012 06:51 Go to previous message
Hawkeye

 
Messages:1800
Registered:October 2005
Location: Australia
Well it seems there can be another factor with large graphics 'popping' or not redrawing correctly: offset.

It seems if the offset is larger than the graphic itself, say for example if your graphic is 150 high but your offset is larger, like 170, the graphic will pop. This can cause problems if your graphics need a large offset, such as large graphics that have been sliced and then need a large offset to connect properly. Tile values can be shifted in the JSD, but I haven't ventured into trying that.


Previous Topic: Win. 7 64-bit & new system issues...
Next Topic: Short freezes ruin my game.
Goto Forum:
  


Current Time: Fri Aug 17 12:58:27 EEST 2018

Total time taken to generate the page: 0.01181 seconds