Christmas in Spring - Page 2

Christmas in Spring

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

User avatar
Zenka
Posts: 1235
Joined: 05 Oct 2005, 15:29

Post by Zenka »

</me hold enthusiasm>lemmy get this straight. you mean you've created a sort of texture displacement?
User avatar
Dragon45
Posts: 2883
Joined: 16 Aug 2004, 04:36

Post by Dragon45 »

The point is not that it's old hat, the point that its supported in Spring via LUA :P

Really trepan you shoudl just rip more of spring and replace it with LUA :P
j5mello
Posts: 1189
Joined: 26 Aug 2005, 05:40

Post by j5mello »

not so...

think of it like this:

Spring is the car. LUA is an aftermarket parts garage that allows u to do all this crazy shizzle with ur car (AKA Spring) like off road (FPS games), Rally Racing (think NS or Iron Grip for HL2), or just fine tune ur racing ability (less TA-esque RTSes).
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

:shock:

Ok, now for brass tacks, though: what exactly would the workflow be, to:

A. Add a normal-mapping shader.
B. Have it invoked through LUA.
C. Have it applied to a model.
D. Exclude from cards that do not support shaders.

i.e., I'd love to be able to use normal maps, but I have zero idea how to get from A to D here.

Moreover, I can see that this makes all sorts of interesting stuff possible, but I guess I'm really having trouble seeing how we're going to apply it to models or FX scripts, which is where the action's at, in terms of making anything more interesting than a map with "weather". Not that that isn't really kewl. But when we can add this to units, then we're really cooking with gas. I can already see it- metallic shaders with iridescent colors applied via a bitmap, animated textures, procedural warping stuff... all of the kewl things shaders can do, liberated into Spring. Just need to cross the line and go from applying it to the GUI elements to S3O meshes without causing 'orrible things to happen. Of all of the things you've done, Trepan, this could in the longer term be one of the biggies- it could totally transform the graphical capabilities of Spring- IF we can apply it to "working objects"- the bitmaps used by maps, the geometry used by mesh models, etc.

Tell ya what: I will be more than happy to make a nifty normalmap and detailed walkthrough for a NB unit for display and testing purposes, if you will help us get past square one here. Because this could be a really gigantic big deal. Like about half of this stuff in the next release... only even I am smart enough to see that I won't have to bury myself in LUA code to mess with this, if the path from shader ---> model/texture data ---> renderer is made clear.

Oh, and while I'm musing about this... can we use it to FINALLY read the blue channel of our S3Os and do whatever we want with them, like I proposed we should be able to do, oh, about a year ago? That would be IDEAL, because we're already loading that texture, we have a full 256-color channel available, and if we have some way of saying what shader to apply, then we're golden, because we can apply that shader with only very modest performance hits beyond whatever resources the shader eats while running. Just askin'.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

Can't go to C, you have to call the unit draw through Lua. Would be pretty fast if you used a drawlist for the mesh, a vertex shader for the animation and some skeletal animation format to feed the animation in there.Make a Lua parser for md5mesh and md5anim and do that. You can disable the unit drawing with some Lua call beforehand. Then you have the one-two combo of custom shaders AND skeletal animation that can just be exported from some animation program.

Oh and please release it under a less restrictive license than GPL, otherwise I'll be forced to reimplement it just to let mods choose any license they please (e.g. Smoth couldn't use GPL code since he wants to maintain creative control over his mod).
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

If we can't go to C, and we don't have code to import another model format <imagines trying to get MD5 animations to have anything like the flexibility of BOS, and shudders with horror at the amount of animations you'd need to build, let alone call through a fairly slow interface> then this is not really useful yet.

However, I see no real practical reason why it cannot read the drawlist directly from the drawlist created by the S3O, and use that blue channel in bitmap 2, or an arbitrary range of bitmaps specified by a user within custom LUA rules.

And, just for the record, Smoth is in no position to defend copyrights to anything but ancillary stuff like BOS scripts in his project anyhow, so I really think that's a moot point. It's not like he could sue for use of his models, when they're clearly in violation of Bandai's copyrights in the first place. So that's kind've a red herring, imo.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

Smoth isn't going to sue anyway since that's a waste of money for something like this but he doesn't want people to take Gundam and make "extreme Gundam" or drop the units into other mods, if he used GPL stuff he'd be forced to allow that, no? Also personally I reject the idea of "take it but these are the strings attached:", I wouldn't take a GPL script simply because I want to keep my options available and if I want to say "use it however you see fit" I don't want the GPL hindering me.

I don't think there's a drawlist for the complete s3o, after all you can't rotate parts of a drawlist, it would have to be one list per piece and with Lua you'd have to read their rotations and render them in the right places.

Also I don't know what you're trying to do but it has to be something insane if you say using normal keyframe animation is too limited. You realize you can mix animations and have controller bones that can be turned to make the unit aim, etc?
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

You realize you can mix animations and have controller bones that can be turned to make the unit aim, etc?
Er, last time I checked, you don't want to use real-time blending in a RTS, that's far too wasteful. That's why in games like DOW, the characters don't actually aim at the targets- they just turn until they're centered, then run an animation. Real-time mesh deformation via IK is strictly for a FPS or something where you can afford to use that much CPU manipulating the verts and doing interpolation calculations.

Anyhow, this is all completely irrelevant. If I can't hook into my existing content base, which represents many man-months of people's free time at this point, then I'm not using this.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

IK? Who was talking about IK? You realize that adding some rotation to the spine bones won't take much processing power (at least not any more than turning a piece)? DoW's units do aim at their targets, you could've tried the WIP Tau mod where aiming wasn't implemented yet, all units shot into the wrong direction.

Also who's talking about using the CPU? I said GLSL shader, that runs completely on the GPU.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

<shrugs> look, I'm not trying to argue here. I thought you meant IK, because you're talking about MD5, which is an IK format, to my knowledge, used in FPS games which use interpolated poses. But that's as much as I actually know about that topic, frankly- I've never modeled any characters for a FPS before, and all my experience with IK systems is from working in Poser, which is probably completely different anyhow.

I'm just saying that if this doesn't work with S3O, I am not using it, because we have too much time invested in S3O content, our pipeline is about delivering it and getting it integrated into Spring... and I'm not at all interested in porting it.

If there's an easy, straightforward, documented and flexible path to using, for example, the blue values of Texture2 in a S3O to apply shaders to a model, then that's a powerful and flexible tool in my toolkit, using technology I already know, like, and understand how to use, and "all" I have to do is find an appropriate GLSL shader, or write one, and then implement it into the game I'm working on. Not an impossible task, for somebody in the middle of a huge project.

If it requires a completely new workflow, requires that I spend a lot of time staring at LUA code that I already lack enough time to deal with, and requires that I port models to a format I don't even know anything about, then I'm simply not interested at this time, k?

I understand that you're excited about this for different reasons than I am, and by all means, do whatever you think is kewl. I'm sure there are bazillions of things that can be done with this, most of which I'm too dense to imagine. But all I'm interested in, frankly, is three things:

1. Alpha transparency, FINALLY.
2. Bumpmaps. Simple, grayscale, good ol' fashioned I've been using them for a decade bumpmaps, or full-blown normalmapping... I don't care, honestly. For the scale and polycount we're dealing with, the faster that shader runs, the better- I don't want to build Oblivion, I just want some extra highlighting and surface detail without adding tricount that will count every rendering pass.
3. Surface shaders for specific color / lighting FX, such as a reflective shader that gives me control over top-end and low-end RGB values for specular and shaded areas, for better simulation of metallic surfaces.

Relatively "simple" stuff, really- just a year or two behind the bleeding-edge stuff of last year's games. It'd make a world of difference to the final feel of my game, though.

I'd love to see a Kernel Panic version, for example, that used animated textures, scripts to generate a call to a shader during COB events (for example, I'm sure that zwxwg's current nifty tricks could be better-done through LUA than through COB, but I digress)... or other stuff. That's great, and I'm all for it.

But, at the same time, I can't use that stuff, either- I have way too much else on my hands right now, and a pause to mess with this is just not in the works for at least another month or so, while the major content issues are being dealt with...
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

There is no such thing as an IK format for games. Doom 3 has IK for the feet but e.g. Quake 4 doesn't use that FootIK stuff. Aiming is FK anyway. Though I think the walkanims for those spidermechs the elite TA scripters made would qualify as IK.

Greyscale bumpmaps aren't used these days anymore (at least internally), it's less complicated (for the hardware) to use a dot3 bumpmap AKA normalmap since a heightmap would have to be converted to normal offsets at rendertime anyway so why not store the normal offsets in the texture and get more flexibility for free? AFAIK the Doom 3 engine converts heightmaps into dot3 bumpmaps at loadtime.
User avatar
MR.D
Posts: 1527
Joined: 06 Aug 2005, 13:15

Post by MR.D »

After looking at the warp effect, would it be possible to add a LUA script that uses the warp center as a toggleable Zoom effect?

Say a smaller area over the cursor that acts like a magnifying glass?

For instance if you're zoomed out far in game, and want to look closer at a specific area without taking your eyes off the whole picture.

Yes there is a minimap for this, but would still be neat.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

Would be difficult since currently it uses the picture that's already rendered so magnifying it will make it pixely.
User avatar
aGorm
Posts: 2928
Joined: 12 Jan 2005, 10:25

Post by aGorm »

:shock: Topic Res :shock:

Anyway, I was wondering, in the next version of spring will all this stuff be available? Will I be able to add rain into the tree map? Seeing as I have to wait for the next version anyway, I thought I should see if rain in it was possible aswell. (Then I can do a rain and a sunny version, WOOT)

aGorm

::::Edit:::: ALSO, cause I have no idea how to add LUA stuff to a map, would anyone be able to fill me in on it?
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Post by trepan »

Support for lua shaders has been in SVN for a while now.

Here's a package I made for ya:
http://trepan.bzflag.bz/spring/zip/LuaGaia-rain-000.zip

It contains the gadgetHandler source code, and two gadgets.
The Gadgets/precipitation.lua is the one that will interest you
(the cmd_doline.lua gadget is useful for dev'ing lua gadgets).
http://trepan.bzflag.bz/spring/lua/precipitation.lua

Unzip the package into your map, repackage the map, and try
the following commands (as the host player):

.luagaia help
.luagaia help rain
.luagaia rain 0
.luagaia rain 1
.luagaia rain speed -100
.luagaia rain speed 250
.luagaia rain scale 500
.luagaia rain scale 5000
.luagaia rain density 10000
.luagaia rain density 100000
.luagaia rain texture bitmaps/arm1.gif
.luagaia rain texture bitmaps/circularthingy.tga

Once you've got the settings you want, edit the variable
settings at the top of the Gadgets/precipitation.lua file.

P.S. If you plan on adding your own texture, I'd suggest
placing it in LuaGaia/Images/yourtexname.png
User avatar
aGorm
Posts: 2928
Joined: 12 Jan 2005, 10:25

Post by aGorm »

Cool, and just to check, all that in the map zip? Its basicly like having another folder like 0bjects3d and textures, ect.... and special LAU folder. Wicked!

Now if only I wernt going on holiday tommorow, and my computer was not in teh middle of a compleat re build I copuld try it out and post a screeny... :( so you'll all have to wait a week.

aGorm
Warlord Zsinj
Imperial Winter Developer
Posts: 3742
Joined: 24 Aug 2004, 08:59

Post by Warlord Zsinj »

I thought you were too busy IRL ;)

Looking forward to seeing a rainy map!

See if you can get random flashes of light in the sky as well!

(maybe a gaia object that spawns explosions in the sky randomly?)
User avatar
aGorm
Posts: 2928
Joined: 12 Jan 2005, 10:25

Post by aGorm »

Yhe well this will probablie be the last thing I do... (even if it kills me)

Comp is still in bits at the mo so still can't test this. But atleastt he new version of spring is out!

( wont say ever because in a few months I'll prob get bord and try to break somthing new.)

aGorm
User avatar
LOrDo
Posts: 1154
Joined: 27 Feb 2006, 00:21

Post by LOrDo »

Hmm, has anyone got this implemented in a map yet?
(It is map defined, right?)
User avatar
Neddie
Community Lead
Posts: 9406
Joined: 10 Apr 2006, 05:05

Post by Neddie »

You want me to implement it in something? Imperfect could do with a little gimmick.
Post Reply

Return to “Lua Scripts”