Back into modding, but facing many problems

Discussions about Coding and Scripting
Darkness
Experienced
Posts: 81
Joined: Mon Mar 01, 2010 10:12 pm
Location: Brazil

Back into modding, but facing many problems

Post by Darkness »

Hey there! I've decided to get back into UT99 modding this week, mainly due to the makeitsuperhot contest, but my goal is actually to have fun with it.

Anyway, I'm trying to do a few stuff that I can't make work quite right.


Problem #1: Time dilatation

The mod resolves around slowing things when you're stopped, so basically, there's a time dilatation (like slomo) based on your speed.

I made the calculations, made a timer on the mutator itself with 0.1 timer, and it checks your speed, relative to your max speed, to it sets time dilatation based on that.

It seems the game has a minimum time dilatation set somewhere, maybe engine limited... as even setting a lower time dilatation, a few stuff seems to run slower (like muzzle flash), but actors seems to move at the same speed, using time dilataion 0.1 and 0.01.

To get around this, well, I've set a "foreach all actors" in the same timer. It'd set ground/air/water speed for players/bots, and relative X velocity for projectiles... so far, it works. Basically, when you stop, the time dilatation is set to 0.1 (minimum), and the players and projectiles have their speed limited to 10% as well, so effectively, it's a fake 0.01 time dilatation for moving, relevant actors.

Any suggestions to do this more elegantly, or in a simpler way? I'll end up redoing all weapons and projectiles (as this mod can't have tracehits, you know), so I'll probably move the velocity check on projectitles to themselves with timers on them, checking the current level timedilatation there.


Problem #2: Texture replacement

I've tried to mimic SUPERHOT visual style, by adding a few 1x1 textures, and replacing them again on the timer that foreach all actors... projectiles are black, weapons grey, pawns red... etc. For now, I'm doing like this, I'll also probably change weapon and projectiles textures "manually", since I'll make new versions of them to control things better.

The main problem here is that I'd like to remove the texture from the level surfaces. I've tried many ways checking this... since I don't know shit about map editor, I have no clue if it's even possible. I tried all ways checking for actor or anything, even onhits to deal with this, but no solution found.

The closest I got to this was placing lightning on all actors, with a specific hue and low brightness, so all surfaces (most of them, actually) become tinted. But since I'd like a light grey shade on all surfaces to mimic superhot, I really have no clue on how to do this, as white light didn't "tint" them, just make them more visible. Any ideas?


Problem #3: Sound pitch change

The same timer tick on mutator sets sound pitch to all actors proportial to the time dilatation. It seems to work only on ambientsounds (like on Minigun fire, and a few other stuff), but is ignored on pretty much everything else.

Is there a easy way to do this effect, by either making an inventory item to affect the player?


There are the main problems I've stumbled upon while making the mod. Is already "functional", limited as it is, if anyone is interested I can share the .u and .int for you to see how it goes.

Thanks and advance!
User avatar
EvilGrins
Godlike
Posts: 9668
Joined: Thu Jun 30, 2011 8:12 pm
Personal rank: God of Fudge
Location: Palo Alto, CA
Contact:

Re: Back into modding, but facing many problems

Post by EvilGrins »

Debating if link you to the Screenshots thread or just repost here.... hmmm...
Darkness wrote:Problem #1: Time dilatation
There's an amazing Assault map called:
Image

You fight your way into the base (I'm going somewhere with this, hang on) and there's a reactor near the middle. When it goes unstable time slows down for everything on the map, both teams, for awhile:
Image

Image

Image

While time is unstable and everybody's moving slow, color spectrum shifts, and an animated distortion effect fills the screen:
Image

Full title of the map is AS-FoT-Chronoshift. Maybe track it down, see how it did it and then adapt a method from that?
http://unreal-games.livejournal.com/
Image
medor wrote:Replace Skaarj with EvilGrins :mrgreen:
Smilies · viewtopic.php?f=8&t=13758
schwap
Novice
Posts: 20
Joined: Thu Aug 25, 2016 1:06 am

Re: Back into modding, but facing many problems

Post by schwap »

Darkness wrote: Problem #1: Time dilatation

The mod resolves around slowing things when you're stopped, so basically, there's a time dilatation (like slomo) based on your speed.

I made the calculations, made a timer on the mutator itself with 0.1 timer, and it checks your speed, relative to your max speed, to it sets time dilatation based on that.

It seems the game has a minimum time dilatation set somewhere, maybe engine limited... as even setting a lower time dilatation, a few stuff seems to run slower (like muzzle flash), but actors seems to move at the same speed, using time dilataion 0.1 and 0.01.

To get around this, well, I've set a "foreach all actors" in the same timer. It'd set ground/air/water speed for players/bots, and relative X velocity for projectiles... so far, it works. Basically, when you stop, the time dilatation is set to 0.1 (minimum), and the players and projectiles have their speed limited to 10% as well, so effectively, it's a fake 0.01 time dilatation for moving, relevant actors.

Any suggestions to do this more elegantly, or in a simpler way? I'll end up redoing all weapons and projectiles (as this mod can't have tracehits, you know), so I'll probably move the velocity check on projectitles to themselves with timers on them, checking the current level timedilatation there.

Theres a minimum timedilation set in the SetGameSpeed(..) function (found in engine.gameinfo and subclasses)

Code: Select all

function SetGameSpeed( Float T )
{
	GameSpeed = FMax(T, 0.1);
	Level.TimeDilation = GameSpeed;
}
Darkness wrote: Problem #2: Texture replacement

I've tried to mimic SUPERHOT visual style, by adding a few 1x1 textures, and replacing them again on the timer that foreach all actors... projectiles are black, weapons grey, pawns red... etc. For now, I'm doing like this, I'll also probably change weapon and projectiles textures "manually", since I'll make new versions of them to control things better.

The main problem here is that I'd like to remove the texture from the level surfaces. I've tried many ways checking this... since I don't know shit about map editor, I have no clue if it's even possible. I tried all ways checking for actor or anything, even onhits to deal with this, but no solution found.

The closest I got to this was placing lightning on all actors, with a specific hue and low brightness, so all surfaces (most of them, actually) become tinted. But since I'd like a light grey shade on all surfaces to mimic superhot, I really have no clue on how to do this, as white light didn't "tint" them, just make them more visible. Any ideas?
I'm not actually modding for UT99, but for another UE1 game.. I don't know about an easy way to actually REPLACE the textures without editing maps directly.
Quite sure with the native extensions in UT99 ( like XC_Engine ) it should be possible somehow. (?)

Anyways, here are 2 methods to accomplish changes to level textures.
----------------------------------------------------------------------------------------------------------

- spawn a new texture 1 uu above them:
Spoiler
Image
-
Image

- "merge" the existing texture and a new one:
(this could be used the create the light grey shade on the level textures - works by modifying Texture.MacroTexture during Runtime)
Spoiler
Image
-
Image
- :ironic:
Image
:idea:

( didn't try to get any fancy screenshots/examples there, just showing the way it works )
Darkness
Experienced
Posts: 81
Joined: Mon Mar 01, 2010 10:12 pm
Location: Brazil

Re: Back into modding, but facing many problems

Post by Darkness »

EvilGrins wrote: There's an amazing Assault map called:
Image

You fight your way into the base (I'm going somewhere with this, hang on) and there's a reactor near the middle. When it goes unstable time slows down for everything on the map, both teams, for awhile:

While time is unstable and everybody's moving slow, color spectrum shifts, and an animated distortion effect fills the screen:

Full title of the map is AS-FoT-Chronoshift. Maybe track it down, see how it did it and then adapt a method from that?
Thanks, will look into it to see how it plays.

schwap wrote:Theres a minimum timedilation set in the SetGameSpeed
I noticed that before, since I already knew the slomo command has a limit, so I instead used Level.TimeDilation directly, and it still seems that it has some limit. I believe the Level.TimeDilatation has some limit, as well as a minimum timer... usually bound to CPU, but I guess it must have some limit stabilished somewhere.

schwap wrote:I'm not actually modding for UT99, but for another UE1 game.. I don't know about an easy way to actually REPLACE the textures without editing maps directly.
Quite sure with the native extensions in UT99 ( like XC_Engine ) it should be possible somehow. (?)

Anyways, here are 2 methods to accomplish changes to level textures.

- spawn a new texture 1 uu above them:
- "merge" the existing texture and a new one:
Thank you! I thought about using "decals" at first, but I guess they'll give some trouble on edges and all, so I gave up using them, but the second solution seems great, will see if I can do that, thank you!



EDIT: trying changing stuff on texture via console to see what happens... SO MUCH FUN!

Code: Select all

set texture btransparent true
SO DOPE


EDIT2: Couldn't set the wall colors right, as I wanted something with light grey, and it seems these MacroTextures don't render light colors over the texture, but I guess it'll be enough... better than nothing!
Darkness
Experienced
Posts: 81
Joined: Mon Mar 01, 2010 10:12 pm
Location: Brazil

Re: Back into modding, but facing many problems

Post by Darkness »



That's how it is right now. I've yet to replace all weapons, fix a few stuff... the level colouring isn't why I wanted, but I still couldn't make it work like it's supposed to.

Textures should be white... is it possible to destroy the textures in the world, then, instead of applying a macrotexture over them, or something? Or replace them, I don't know...

I'm a little lost regarding this, I would never have guessed that the textures were like present in there and could be referenced or affected via console command. I only messed with actors before, and I really have no clue on how to do things like a "foreach" for textures to even try some stuff. I guess I don't really know much about the engine as I thought.
User avatar
papercoffee
Godlike
Posts: 10443
Joined: Wed Jul 15, 2009 11:36 am
Personal rank: coffee addicted !!!
Location: Cologne, the city with the big cathedral.
Contact:

Re: Back into modding, but facing many problems

Post by papercoffee »

Darkness wrote:

That's how it is right now. I've yet to replace all weapons, fix a few stuff... the level colouring isn't why I wanted, but I still couldn't make it work like it's supposed to.

Textures should be white... is it possible to destroy the textures in the world, then, instead of applying a macrotexture over them, or something? Or replace them, I don't know...

I'm a little lost regarding this, I would never have guessed that the textures were like present in there and could be referenced or affected via console command. I only messed with actors before, and I really have no clue on how to do things like a "foreach" for textures to even try some stuff. I guess I don't really know much about the engine as I thought.
Wow ...nice. This looks somehow very cool.

I had once the problem that my Open GL driver got kaput or irritated and the whole game lost it's textures but not the light-maps.
Maybe it's something you can change that way.
I can't find the screenshot.
Darkness
Experienced
Posts: 81
Joined: Mon Mar 01, 2010 10:12 pm
Location: Brazil

Re: Back into modding, but facing many problems

Post by Darkness »

papercoffee wrote:Wow ...nice. This looks somehow very cool.
Thanks!
papercoffee wrote:I had once the problem that my Open GL driver got kaput or irritated and the whole game lost it's textures but not the light-maps.
Maybe it's something you can change that way.
I can't find the screenshot.
Well, I managed to "replicate" that with this consome command:

Code: Select all

Set texture palette Palette'Botpack.Ammocount.Palette0'
Didn't work right away, a few textures disappeared on the map, and on all players, but after an alt+tab, everything was black and white:

Image

So, yeah, nailed it... EXCEPT that I don't want to remove the texture from everything, just from the level textures!!! Any ideas?

Problem 1: How to affect level textures without the "set " console command? Is there a way to iterate through them?
Problem 2: How to detect if such texture is from level, and not from anything else? Does it have an owner, does it have some property that makes it different from the others?
Darkness
Experienced
Posts: 81
Joined: Mon Mar 01, 2010 10:12 pm
Location: Brazil

Re: Back into modding, but facing many problems

Post by Darkness »

For now I gave up on this... tried pretty much anything I could think of.

I actually managed to have a texture of the "tracers" working in red, maybe because it was loaded after the command... but still, the texture of weapons and pawns were gone and couldn't be reloaded.

Unless there's a way to "reaload" certain textures (so I'd have to load textures from my mod, and of course the UT Menu, which is also affected by the command, lol), after doing this palette swap, I really have no clue about how use this properly. UnrealEngine1 seems to have no iterators for non-actors that I could use to go through them individually.

Right now I've began replacing the weapons and doing projectiles, all with the default uHot trail (basically a red tracer)... so far it's looking really good!
User avatar
PrinceOfFunky
Godlike
Posts: 1200
Joined: Mon Aug 31, 2015 10:31 pm

Re: Back into modding, but facing many problems

Post by PrinceOfFunky »

About the texture replacement, read the first answer of sn260591, she/he talks about directX10 being able to replace textures with external ones without modifying the map(if I remember good): https://www.ut99.org/viewtopic.php?f=5& ... ump#p76255
"Your stuff is known to be buggy and unfinished/not properly tested"
Darkness
Experienced
Posts: 81
Joined: Mon Mar 01, 2010 10:12 pm
Location: Brazil

Re: Back into modding, but facing many problems

Post by Darkness »

PrinceOfFunky wrote:About the texture replacement, read the first answer of sn260591, she/he talks about directX10 being able to replace textures with external ones without modifying the map(if I remember good): https://www.ut99.org/viewtopic.php?f=5& ... ump#p76255
Thanks, will look into this later and give it a try... although I wouldn't be too happy to force the usage of an alternative renderer! But if I can make it work easily, well... might be a solution!
User avatar
PrinceOfFunky
Godlike
Posts: 1200
Joined: Mon Aug 31, 2015 10:31 pm

Re: Back into modding, but facing many problems

Post by PrinceOfFunky »

And about the custom time dilation and the sound pitch using a custom inventory item as you said, you could use AdvancedMutator, which already gives a custom inventory item for everything in the map, since I didn't make any tutorial yet(not sure if it is needed), I would reccomend you to view some examples at the bottom of the first post. If you need help just ask :D (Hoping I will be online at that moment lol)
"Your stuff is known to be buggy and unfinished/not properly tested"
Darkness
Experienced
Posts: 81
Joined: Mon Mar 01, 2010 10:12 pm
Location: Brazil

Re: Back into modding, but facing many problems

Post by Darkness »

PrinceOfFunky wrote:And about the custom time dilation and the sound pitch using a custom inventory item as you said, you could use AdvancedMutator, which already gives a custom inventory item for everything in the map, since I didn't make any tutorial yet(not sure if it is needed), I would reccomend you to view some examples at the bottom of the first post. If you need help just ask :D (Hoping I will be online at that moment lol)
Hey! Yeah, I noticed that post before when searching for a few stuff.

And I actually still haven't used a custom inventory item, it still wasn't needed.

I'd use your mutator for some callbacks, IF I didn't create individual weapons for example, the "actor shoots" would surely be great, so I would be able to use my mutator with any weapons. But I actually gave up on that, when I decided to create each weapon, based on the original UT weapon, as I also had to change other stuff on them.

The time dilatation is working fine, but as I said, it looks like there're some engine limits... values below 0.1 seems only to affect muzzle flash and others, but not projectiles, timers and other stuff. So, probably just Canvas, not actors per se.
User avatar
PrinceOfFunky
Godlike
Posts: 1200
Joined: Mon Aug 31, 2015 10:31 pm

Re: Back into modding, but facing many problems

Post by PrinceOfFunky »

Darkness wrote:
PrinceOfFunky wrote:And about the custom time dilation and the sound pitch using a custom inventory item as you said, you could use AdvancedMutator, which already gives a custom inventory item for everything in the map, since I didn't make any tutorial yet(not sure if it is needed), I would reccomend you to view some examples at the bottom of the first post. If you need help just ask :D (Hoping I will be online at that moment lol)
Hey! Yeah, I noticed that post before when searching for a few stuff.

And I actually still haven't used a custom inventory item, it still wasn't needed.

I'd use your mutator for some callbacks, IF I didn't create individual weapons for example, the "actor shoots" would surely be great, so I would be able to use my mutator with any weapons. But I actually gave up on that, when I decided to create each weapon, based on the original UT weapon, as I also had to change other stuff on them.

The time dilatation is working fine, but as I said, it looks like there're some engine limits... values below 0.1 seems only to affect muzzle flash and others, but not projectiles, timers and other stuff. So, probably just Canvas, not actors per se.
You could check for the Matrix Mod for UT99 which slows down projectiles(custom ones actually). Without replacing weapons you could decrease or increase their velocity, acceleration and life span.
"Your stuff is known to be buggy and unfinished/not properly tested"
Darkness
Experienced
Posts: 81
Joined: Mon Mar 01, 2010 10:12 pm
Location: Brazil

Re: Back into modding, but facing many problems

Post by Darkness »

PrinceOfFunky wrote:You could check for the Matrix Mod for UT99 which slows down projectiles(custom ones actually). Without replacing weapons you could decrease or increase their velocity, acceleration and life span.
Hmmm, I remember it! But I thought it used some kind of "playersonly" triggered via a button to stop everything, I really don't remember the slowdowns... will try it later, thanks!
Darkness
Experienced
Posts: 81
Joined: Mon Mar 01, 2010 10:12 pm
Location: Brazil

Re: Back into modding, but facing many problems

Post by Darkness »

Just explaining a bit further the situation regarding projectiles: I didn't have to actually remake the weapons and projectiles from UT to apply the physics. The whole slowdown is controlled only by the mutator, via a 0.1 timer, with a foreach allactors trigger. Yeah, very intensive, but works fine.

I decided to remake weapons because there're tracer weapons (enforcer, sniper rifle, minigun, pulse gun and shock rifle), and trace hits make it impossible to dodge the shot for real like in superhot, so I'd have to at least remake them to put the "bullets and other projectiles" replacing the tracer. I actually did this logical replacement before on my previous weapon mods, Apocalypse Weapons and Maverick Hunters.

To mimic the SUPERHOT visuals, I did crude texture replacements on the mutator, which worked "fine" in general: black projectiles, red actors, grey weapons... low textures, pretty easy, worked well.

BUT, the projectiles need to have red trails. So, it's best that I remake all of them, at least to add the trails, right? So I could make custom trails and all, and use the tick on projectiles on a few tricky trajectories. Working fine. Again, I'm aware I could attach trails to any projectiles via the mutator itself, but I wouldn't be able to actually control the proportions, it'd be too dynamic to be smart.

Two other things that forced me to redo projectiles (because of the visual art adopted) were the Sprite ones and the Transparent Mesh ones. For sprites, I have to actually create a custom texture for them, with grey background and paint the projectile black, and import is as masked. For transparent meshes, it seems they don't accept masked textures anyway... so I'll have to either replace models or use masked textures on them.

Image
Here you can see a "shock rifle ball" with black texture and red trail.

So, I'm replacing all weapons and projectiles! I only need to replace Pulse Gun and Redeemer now... Pulse Gun will be tricky because of the Beam fire, I'll have to find a way to make it dodgeable, like a succession of projectiles with trails... I'll check if it won't lag the engine, lol. But since I want it to be dodgeable... also, I won't be able to use its original mesh I guess... I guess I'll use the original mesh painted red as trail, and a masked texture on its tip. Anyway, that's my next step.

For redeemer, I'll just add a trail, it's easy, lol.

After finishing the weapons, I'll also replace all muzzle flashes and explosion sprites to "match" the style in SUPERHOT. I actually have to play the game a little more to see this... as so far I haven't seen explosions, just muzzle from the weapons, but I can make the explosions based on it just fine.

The goal of my mod is to provice a "classic UT experience", with a "taste of SUPERHOT". So, forcing a version of the original UT weapons isn't a bad design choice, I guess.


Also, a nice user PM'd me suggesting me to check a specific mod, trying to help me on the gravity problem. So I explained him better that's the problem my falling projectiles have with gravity: I want the gravity to still act on the actors, but have less impact on their velocity when the time is slowed down, but I still want their "falling curve" to the the exact same they'd have in the normal game.

I guess the only perfect way to get around the engine is to set physics_none on the physics_falling projectiles, and "simulate the engine physics trajectory manually", so it won't have a minimum velocity like gravity applies... but I won't bother messing with this anytime soon, since it feels too complicated.

Also, I'll check Matrix Moves later, but I really guess it just would use standard 0.1 time dilatation at most, so it wouldn't really help. Let's see!


I'd like to thank everyone for the replies, and for keeing UT alive all this time. Also, if anyone wants to try the current version of the mod, either out of curiosity or to contribute, feel free to say and I'll gladly share it.


EDIT: while editing to post the image of the black shock ball, I just noticed I'll really have to remove the level textures/paint them white to make these black masked texture projectiles visible... lol.
Post Reply