Home » MODDING HQ 1.13 » v1.13 General Development Talk » Interlocking JSD structures
| Interlocking JSD structures[message #270941]
|
Sat, 22 January 2011 02:24
|
|
Hawkeye |
  |
Messages:2476
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?
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?
[Updated on: Mon, 01 June 2020 09:09] Report message to a moderator
|
|
|
|
|
| Re: Interlocking JSD structures[message #271736]
|
Sat, 29 January 2011 08:14 
|
|
Hawkeye |
  |
Messages:2476
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...
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.
Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
| Re: Interlocking JSD structures[message #272276]
|
Thu, 03 February 2011 05:54 
|
|
|
|
HawkeyeThanks 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.
Report message to a moderator
|
|
|
|
|
|
|
|
|
| Re: Interlocking JSD structures[message #272296]
|
Thu, 03 February 2011 09:23 
|
|
Hawkeye |
  |
Messages:2476
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:
Report message to a moderator
|
|
|
|
|
|
|
|
|
| Re: Interlocking JSD structures[message #272677]
|
Sat, 05 February 2011 05:29 
|
|
Hawkeye |
  |
Messages:2476
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.

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.
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...
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.
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] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Goto Forum:
Current Time: Fri Jun 12 01:32:58 GMT+3 2026
Total time taken to generate the page: 0.01126 seconds
|