What are the limitations of X-Ray?

Discussions on Modding of S.T.A.L.K.E.R. SoC & Clear Sky

What are the limitations of X-Ray?

Postby silverpower on 14 Sep 2008 01:48

The title says it all - what do you think are the limitations? What can and can't be done? I mean both inadequate tools and inadequate exposure of alife features here.

I ask because I'm currently toying with a total conversion for either FEAR or Stalker - either will work, but they both have their ups and downs. The design doc isn't written yet, and neither is the script, so I'm afraid I can't answer very many questions on it.

I really wish I could use X-Ray for this specific project, but FEAR has features I like, even if I'll have to write inventory code from scratch and bang my head against a modeling workflow I understand even *more* poorly than X-Ray's. It also has wonderful combat AI. (It does, however, lack alife, and alife brings in emergent behavior that can be quite useful.) X-Ray 1.0 has fewer features and a combat AI that's not all *that* great . X-Ray 1.5 improves on this, but we don't have any tools aside from the unpacker. It's also quite unstable. At least Lua has JIT available - absymal script performance is pretty much a thing of the past, unlike 1.0.

Anybody have other gripes about Stalker's engine? :) Don't get me wrong, I still have much love for X-Ray, it's just that I like having a bit more control over engine internals than we'll ever have with X-Ray (short of them finally deciding to get their asses in gear and clean up their code for a SP-SDK release).
KMFDM forward, the ultimate sound/And a message from Satan, if you turn it around
silverpower
Senior Resident
 
Posts: 25
Joined: 14 Sep 2008 00:49
Location: exiled to Eastern TN

Postby fatrap on 14 Sep 2008 03:15

Wow silverpower, that is a tough question. The X-Ray engine is pretty amazing... every time I say that something cannot be done, someone finds a way to do it! Look at all the neat stuff the AMK team has managed to do... and from what I've seen of russao's Inferno 1.2, he has managed to do some pretty wild stuff, too!
I love the F.E.A.R. game... but it has a very basic limitation. It just isn't as re-playable as STALKER is (IMO). I do re-play it, but I usually have to wait a few months between games.
If STALKER just had the combat AI of F.E.A.R. .... whew!
User avatar
fatrap
Senior Resident
 
Posts: 203
Joined: 13 Sep 2008 21:20
Location: Fayetteville, Arkansas, USA

Postby ket on 14 Sep 2008 12:13

From a purely visual point X-Ray has no limitations. I've experimented with this a great deal, to the extent X-Ray is rendering photographic quality textures with accurate shadows and lighting, no scruffy "drawn" DDS textures here. As for FPS impact, there is none to speak of.

Something else I did notice recently is to do with particle effects in STALKER, I was playing them in the SDK when I noticed something rather odd (to me anyway) for some reason the max. particle count was higher (or in some cases significantly higher) than what the effect was actually capable of producing. I would think changing the max particles to be more in line with the actual amount of particles being used per effect would speed the engine up quite a lot.
User avatar
ket
Senior Resident
 
Posts: 1262
Joined: 14 Sep 2008 11:57
Location: The solar system

Postby silverpower on 14 Sep 2008 15:55

Yeah, I have zero complaints about the renderer and sound system (netcode is irrelevant since I can't implement co-op anyway in Stalker).

My problem lies with the fact that certain features I'll want to put in are nearly impossible in X-Ray short of mutilating xrGame.dll and friends.

ETA: NPC/actor visual importation is now *proven* to be possible for both SHOC and Clear Sky! Also, gosuke's been able to import new HUD models into Clear Sky. This is excellent news. Check arikai.com's last three posts for some screenies of all three tests. :)
KMFDM forward, the ultimate sound/And a message from Satan, if you turn it around
silverpower
Senior Resident
 
Posts: 25
Joined: 14 Sep 2008 00:49
Location: exiled to Eastern TN

Postby ket on 14 Sep 2008 20:40

Speaking of *proven* things, I can *officially* say that it IS possible to put some kind of realistic stealth element into SoC. It involves setting limited AI hear distances for numerous sounds instead of them all being set to 300 - to which I assume is meters. No NPC vision alterations are needed, so its not "bugged".
User avatar
ket
Senior Resident
 
Posts: 1262
Joined: 14 Sep 2008 11:57
Location: The solar system

Postby NatVac on 17 Sep 2008 19:33

Good info, ket.

silverpower wrote:My problem lies with the fact that certain features I'll want to put in are nearly impossible in X-Ray short of mutilating xrGame.dll and friends.

There is a lot of stuff that is strangely hard-coded in the X-Ray engine, silverpower. That's not a good thing from my perspective. Why they would black-box parts of stuff and not make it truly extensible is bewildering, considering how much good object-oriented (class-based) design went into the original game. "Bad dev! Bad!"

A very small subset of examples of weird partitioning in SoC: the weapon ranking (something you know well), the kill statistics tracking, some PDA stuff (the Marked One's bio pic, rank and reputation are in one black DLL box), arbitrary mutant management (psydog is derived from different class than other mutants -- try changing it to eliminate the stuck threat indicator when you kill the dog; controller's mental roaring sound control is embedded in xrGame.dll -- and it's broken), weapon attachments support, control of Marked One's attributes.

silverpower wrote:At least Lua has JIT available - absymal script performance is pretty much a thing of the past, unlike 1.0.

I don't have CS, so I'm not sure what you mean by JIT being enabled, since I thought it was already. (See SoC's _g.script, top code block; if JIT isn't running, the script profiler hook is installed.) But it would be very easy to optimize some code. For example, the printf() function does nothing in the retail version of SoC, so the myriad debug statements that use it can be safely removed.

Yes, fatrap, russao (russo) and the AMK guys have made the engine dance, but a lot of that is via smoke and mirrors, taking objects offline and using netpackets to change attributes that should be directly addressable. Even then, the extensibility is not fully there. Look at the trouble Decane is going through for the special weapon effects. "The Wizard of Awes" EggChen can tell you about what particle effects work -- or don't work -- where.

The model work by gosuke and the level work by dezodor and others is indeed amazing -- but at what cost? X-Ray and its owners have not made this easy.

Maybe some of this is fixed in CS. Maybe better documentation would help. But in my opinion, X-Ray has a lot of rushed ad hack fixes hard-coded into the implementation, severely crippling the amazing design.* It's as if Elvis wasn't the only one who left the building.

This doesn't mean you can't do what you want, silverpower. But it will be a lot of work with X-Ray. Alife is simply code that recognizes and responds to other NPCs and entities as well as the player -- and even that is quirky in STALKER. Cf. campfire NPCs going for the same spot, pushing each other out of the way, over and over, despite other open spots around the fire. (That's not realistic enough; at some point one or the other should be pulling out a knife. :P)

It might be easier to implement Alife-like qualities in the F.E.A.R. engine than to go shopping for alligator repellent for use in X-Ray's swamp.

X-Ray 1.5 supports better modifiers (e.g., suit and weapon upgrades), but the haphazard implementation can result in losing weapon upgrades simply by putting the weapon down. It sounds like some work is still needed.

____________
*One of the entries on my "Don't Confuse" list: Don't confuse implementation with design. They are not the same.
NatVac
Resident
 
Posts: 152
Joined: 16 Sep 2008 00:13
Location: Texas

Postby EggChen on 17 Sep 2008 21:22

You can do a hell of a lot with the particle editor, it is extremely flexible, but it has one major flaw which I understand is down to the engine.

You cannot do soft fading of particles, you get to a point which is just under .1 alpha where it just dissapears, the engine cannot overlay an effect below that value. So you get a nasty dissapearance rather than a nice fade.

The devs handled this with short lived particles like grenade explosions, its over in less than a second or two so the actual dissappearance is less of an issue. They also have effects that move out of sight like fog, it moves past you and dissapears behind the player, unless your turning around. Also fires and other effects have rising particles that dissapear (generally) above the players line of sight.

Things you can do :

- Particles that spawn others, so a fireball with a trail of smoke.
- Spawning other effects on birth, or death of a particle.
- Static particles like the sticks that identify minefields.
- Interaction with scenery, particles bouncing of surfaces, or reacting when hitting a surface.
- Number and size is virtually infinite, one effect I did had 5,000 snow particles, and didn't cause lag at all.
- Timed particles, so one that starts .5 seconds after the main effect starts for example.
- You can choose where a particle starts, where it goes, rotation, size and colour changes during its lifetime.
- Air and gravity resistance.
- Bouncing of particles off each other.
- Killing particles that pass beyond a certain location.
- Attraction of particles to each other.

A nice example is one of the explosions used for downed choppers, which I have played around with for NEWSA. On explosion it shoots out burning projectiles, which die on impact with the ground, but on death they spawn a small fire effect. That fire effect then spawns smoke and distortion effects.
Last edited by EggChen on 17 Sep 2008 21:24, edited 1 time in total.
User avatar
EggChen
Moderator
 
Posts: 1016
Joined: 13 Sep 2008 00:44
Location: Birmingham, UK

Postby Clay65 on 17 Sep 2008 21:23

Well, for what i've seen, X-Ray is the worst engine i've ever tried to work with...
First of all it has billions of "redundancy calls and checks" during its execution, and that's why there are often lag and stuttering.
They didn't worked at all on optimizing their code, both for engine and for scripts, but while we can (with hard work) work on the scripts, there's
no way for us to have the engine working a bit better.

It has a really low limit (around 2.000.000) for polygons in a map, even it looks like it's been improved in engine 1.5 (maybe sth like 6.000.000),
but the real problem in it it's still (and even in 1.5) the small limit for the AI way-points, that makes really hard to create a variation in the path
of the NPC, so that even with an higher possible number of polygons utilizable, we cannot create larger maps due to the fact that it's impossible
to add some new way-points for the AI, meaning that we can create only larger "deserted maps".

Too many of the functions are hardcoded into DLL (and CS it's even more hardcoded than SHOC) and this is surely not an help when
you wanna try to work with its models and levels.

I feel like they really don't care at all about modding, they didn't realize that most of the ppl has played SHOC for over an year only thanx
to modding community, and in CS it looks (at least actually) that it's even harder to add some "relevant" things in the game.

The A-life it's the only reason to choose X-Ray, but i think that all the negative things that could impact on the work for a TC are more
important (at least if you don't wanna spend 1 year to work on it :D ).
User avatar
Clay65
Senior Resident
 
Posts: 13
Joined: 13 Sep 2008 22:17
Location: Italy

Postby ket on 18 Sep 2008 21:34

Technically you can add AI to new maps if you take the time making a new SP level. Theres numerous ways to do it, but I have always entertained the simplest way - script NPCs in and even if you kill a bunch they will respawn when you next enter the level. Without AI paths the NPCs will just wander about the new level and take up residence wherever they feel like.
Mobo: MSI X570 Tomahawk
CPU: R7 3700X @ 4.4GHz 1.3v
RAM: 2x16GB Klevv BoltX 3600MHz 16-20-20-35
GPU: Powercolor 6800XT Red Devil
Sound: Asus Xonar DX 7.1 PCI-E, Realtek ALC1200
HDD: 250GB & 500GB nVME 3.0 M.2 drives, 2TB Seagate Barracuda, Sata3 64MB Cache, 250GB Hynix SL301
Opticals: DVD-RW, Blu-Ray
PSU: eVGA 1000w G2 Supernova
Case: NZXT Phantom 530

STALKER: Singularity (SIN) homepage
User avatar
ket
Senior Resident
 
Posts: 1262
Joined: 14 Sep 2008 11:57
Location: The solar system

Postby jamie1992 on 18 Sep 2008 21:53

You mean AI Maps? or AI Nodes? as i think both can be made when recompiling a level in the SDK.

@Clay65

Whats with the Super Saiyan Tweety Bird? :shock:
User avatar
jamie1992
Senior Resident
 
Posts: 802
Joined: 12 Sep 2008 23:04
Location: Oxford, Oxfordshire, United Kingdom

Postby silverpower on 20 Sep 2008 05:27

NatVac wrote:
silverpower wrote:At least Lua has JIT available - absymal script performance is pretty much a thing of the past, unlike 1.0.

I don't have CS, so I'm not sure what you mean by JIT being enabled, since I thought it was already. (See SoC's _g.script, top code block; if JIT isn't running, the script profiler hook is installed.) But it would be very easy to optimize some code. For example, the printf() function does nothing in the retail version of SoC, so the myriad debug statements that use it can be safely removed.


X-Ray 1.0 (SHOC, older Clear Sky betas) lacks the JIT. 1.5 has it and has it enabled.

ETA: Clay65, since when did X-Ray use waypoints for anything besides fixed patrol paths assigned through the smart_terrains?
KMFDM forward, the ultimate sound/And a message from Satan, if you turn it around
silverpower
Senior Resident
 
Posts: 25
Joined: 14 Sep 2008 00:49
Location: exiled to Eastern TN

Postby NatVac on 20 Sep 2008 08:19

silverpower wrote:X-Ray 1.0 (SHOC, older Clear Sky betas) lacks the JIT. 1.5 has it and has it enabled.

I have this in the older game's _g.script at the top:
Code: Select all
if (jit == nil) then
   get_console():execute("jit_is_nil")
   -- profiler.setup_hook   ()
else
   get_console():execute("jit_is_not_nil")
end

Guess what? Maybe the game is lying, but the variable jit is not nil in the original STALKER retail game. I wouldn't be surprised to find that the devs disabled it (or didn't implement it) and simply forced the variable to non-nil in a DLL. Or maybe they fixed bugs in the implementation used in Clear Sky.
NatVac
Resident
 
Posts: 152
Joined: 16 Sep 2008 00:13
Location: Texas

Postby silverpower on 22 Sep 2008 09:37

Right, but the DLL that provides the JIT functionality is missing. Is it nil in 1.0.000 as well? Because 1.0004 *is* based on an early CS beta.
KMFDM forward, the ultimate sound/And a message from Satan, if you turn it around
silverpower
Senior Resident
 
Posts: 25
Joined: 14 Sep 2008 00:49
Location: exiled to Eastern TN

Postby Russo on 23 Sep 2008 14:18

lol i will be damned NatVac is a lady. :bounce: :cyclopsani: :bounce:

:geek:

I like fear, the ai is very cool, people think that fear is easy, but it only is because of the slow motion and medkits, other than that i have seen ai do amazing stuffs.

The question is not if fear or stalker is the best thing to mod on, but what do you want to do.

Different than others, i do not think stalker modding is dead and "everything that can be done is already done", nope there are alot things that can be done, every day when im testing something, bang 10 different things hit my head and many are "easy" and simple, but i dont, i would never finish it.

X-ray does have limitation for many things, mostly like because there isnt a good tool to change pda and others stuffs that are hardcoded, i also learned that you cant have too many "features", xray will cry, i had to remove stuffs to make my mod stable, but very much everything that i thought about adding, i did, actually many things that people think that are not possible, its possible, the problem is that it need alot "hacking".

One thing that is very easy and peple think that is not possible, is Artefact Statistics, you see the dll is missing the "artefact" section for stats, but you dont need it, the solution is ugly but it works, all that one need to do is to edit pda ui and rename stalker and mutants kills, change stalker to total kills and mutants to artefact, then edit the script to "update" mutant and stalker kills to stalkerkills section, then you get a total list of stalkers and muatants kills, now create a script that detect when player picked n dropped artefact and add it using the same code, but saving it to "monsterkills", all you need is imagination, it dont need to be mutants, you can remove the quest or then add "stashes found", etc....

Then you may think, but what is the point, is not possible to fix the statistics, wrong again, its possible to fix.


Code: Select all
-- comment the code
-- actor_stats.add_points(props, sect_name, 1, killCountProps[sect_name])

-- then apply the fix, well in my code all kills count as 1

statstype = 2 -- variable tha set where the number of kills will be, like 10x  1 or 1x    10

   local stk = actor_stats.get_points("stalkerkills")
   local mtk = actor_stats.get_points("monsterkills")
    if IsStalker(npc) then
      if stk ~= nil then
         if stk > 0 then
            actor_stats.add_points(props, sect_name, 1, 1)
            local nstk = actor_stats.get_points("stalkerkills")            
            if (stk + 1) < nstk then
               if statstype == 2 then
                  actor_stats.add_points(props, sect_name, -1, 0)
               else
                  actor_stats.add_points(props, sect_name, 1, -1)
                  actor_stats.add_points(props, sect_name, -1, 0)
               end
            end
         else actor_stats.add_points(props, sect_name, 1, 1)
         end
      else actor_stats.add_points(props, sect_name, 1, 1)
      end

   else
      if mtk ~= nil then
         if mtk > 0 then
            actor_stats.add_points(props, sect_name, 1, 1)
            local nmtk = actor_stats.get_points("monsterkills")            
            if (mtk + 1) < nmtk then
               if statstype == 2 then
                  actor_stats.add_points(props, sect_name, -1, 0)
               else
                  actor_stats.add_points(props, sect_name, 1, -1)
                  actor_stats.add_points(props, sect_name, -1, 0)
               end
            end
         else actor_stats.add_points(props, sect_name, 1, 1)
         end
      else actor_stats.add_points(props, sect_name, 1, 1)
      end
   end


You can do the same thing for task script.

To answer the question, i guess at the end the modding wall is your imagination, sure that there things that cant be done, but there are so many things that can be done.
User avatar
Russo
Senior Resident
 
Posts: 12
Joined: 23 Sep 2008 10:32
Location: Rio

Postby EggChen on 23 Sep 2008 20:02

Russo wrote:I like fear, the ai is very cool, people think that fear is easy, but it only is because of the slow motion and medkits, other than that i have seen ai do amazing stuffs.


Definately agree, never been flanked or ambushed in any game like I have been in FEAR, also agree about the difficulty. I played it a few times after disabling the slowmo key in the controls, it is a totally different and possibly better game without slowmo!!

The pda stats is one thing that has always bugged me, it seems there are a few hardcoded barriers to things in Stalker, but as you show there is a way round with some imagination.

Finally, nice to see you here russao :cyclopsani:
User avatar
EggChen
Moderator
 
Posts: 1016
Joined: 13 Sep 2008 00:44
Location: Birmingham, UK

Postby NatVac on 28 Sep 2008 01:45

silverpower wrote:lRight, but the DLL that provides the JIT functionality is missing. Is it nil in 1.0.000 as well? Because 1.0004 *is* based on an early CS beta.

I don't know. I'll be re-installing sometime in the future when time becomes more available, and I can check then.
__________
Russo wrote:lol i will be damned NatVac is a lady. :bounce: :cyclopsani: :bounce:

:geek:

LOL, no, my avatar is a picture of a lady -- my wife, in fact. I'm no lady.

Russo wrote:To answer the question, i guess at the end the modding wall is your imagination, sure that there things that cant be done, but there are so many things that can be done.

I think there are more walls than just imagination. My walls are currently built more from time constraints than imagination. As I mentioned earlier: "This doesn't mean you can't do what you want, silverpower. But it will be a lot of work with X-Ray." And some types of the work are harder for some of us than for others.

Nice workaround to the statistics problem, Russo.

__________
Note to those who might have wondered: ad hack is a pun on the Latin ad hoc.
NatVac
Resident
 
Posts: 152
Joined: 16 Sep 2008 00:13
Location: Texas

Postby Russo on 29 Sep 2008 15:57

NatVac wrote:
silverpower wrote:lRight, but the DLL that provides the JIT functionality is missing. Is it nil in 1.0.000 as well? Because 1.0004 *is* based on an early CS beta.

I don't know. I'll be re-installing sometime in the future when time becomes more available, and I can check then.
__________
Russo wrote:lol i will be damned NatVac is a lady. :bounce: :cyclopsani: :bounce:

:geek:

LOL, no, my avatar is a picture of a lady -- my wife, in fact. I'm no lady.

Russo wrote:To answer the question, i guess at the end the modding wall is your imagination, sure that there things that cant be done, but there are so many things that can be done.

I think there are more walls than just imagination. My walls are currently built more from time constraints than imagination. As I mentioned earlier: "This doesn't mean you can't do what you want, silverpower. But it will be a lot of work with X-Ray." And some types of the work are harder for some of us than for others.

Nice workaround to the statistics problem, Russo.

__________
Note to those who might have wondered: ad hack is a pun on the Latin ad hoc.



oh LOL my bad and thx.

I said the wall is imagination, because like i said, even if you cant do something, there still alot things that can be done.
User avatar
Russo
Senior Resident
 
Posts: 12
Joined: 23 Sep 2008 10:32
Location: Rio


Return to Modding Techniques

Who is online

Users browsing this forum: No registered users and 26 guests

cron