LUA weapons, customizable units

LUA weapons, customizable units

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

Moderator: Moderators

User avatar
Zpock
Posts: 1218
Joined: 16 Sep 2004, 23:20

LUA weapons, customizable units

Post by Zpock »

Im getting good progress in LUA coding, my ui works pretty well. The idea is that you have spaceships that you can put different weapons, afterburners shields various debuff trinkets etc. I realised that trying to control standard weapons in cob is really hopeless and there's no way to interact with weapons in LUA at all. So I started on making custom weapons. I havn't worked much at all on graphics, its just placeholder textures/models as you can see.

Image


ship design screen, basically theres 3 kinds of slots you can fill with modules (different ships have different slot configuration etc):
Image
I was testing if the scroll arrows worked correctly is why theres tons of "light laser" duplicates. You click on a module in the above rows and it's added to the ships slots below. I might add in drag&drop but im not sure seems slow and inneficient altough intuitive.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Finally somebody doing a half decent method of implementing space warfare instead of reverting to flawed FF mechanics
User avatar
rcdraco
Posts: 781
Joined: 22 Nov 2006, 02:50

wow

Post by rcdraco »

BloX in Space? Now I've seen everything. >_<

Really nice work though, I may need to get a hold of this thing.
User avatar
Zpock
Posts: 1218
Joined: 16 Sep 2004, 23:20

Post by Zpock »

Demonstration Video:

http://www.youtube.com/watch?v=LD3z0pf59gw

Ok, so basically, I have most of the framework in place. Units have custom HP, take damage from custom weapons. Weapons (and other things) fire when there is an attack command on a unit nearby. There is a basic graphical beam effect in place.

Things/ideas I plan to (well maybe) do:
  • Floating Damage numbers, WOW style :twisted:

    Amazing beam graphics, now that I can do whatever I want directly in opengl.

    Shield and armor hps. (shield effects?)

    Damage modifiers (% resistances, dmg substraction?).

    Critical Hits, random damage.

    Accuracy (affecting above) from relative unit movement/size etc.

    Missiles, possibly non missile projectiles (that are maybe not scanhit)

    Different Buffs/debuffs instead of just damage

    Non-centered targeting of beams (not just hit the middle all the time)

    Drone units. (think starcraft carrier)
User avatar
Snipawolf
Posts: 4357
Joined: 12 Dec 2005, 01:49

Post by Snipawolf »

Heh heh heh heh, looking nice!

Now, you need to find a way to find a hardpoint, and limit the weapons you can put on it, and make a model appear for each individual weapon and.........


lol, I am not satisfied with merely this :P
User avatar
Zpock
Posts: 1218
Joined: 16 Sep 2004, 23:20

Post by Zpock »

Progress:

Image
Now, you need to find a way to find a hardpoint, and limit the weapons you can put on it, and make a model appear for each individual weapon and.........
I'm working on a first ship model, I want it to be really good tough so it will take a while. The stuff trepan's working on, normal mapping and LOD etcetera could come in very handy. Not sure if i'll do actual turrets, we'll see. It's possible, would need some heavy math to get the angles right for turrets that arn't just ontop the ship but I might get around to it anyway.
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Post by imbaczek »

you need to do something that's called scene node tree (or graph) to do it easily and yes, this involves some nontrivial maths. That's one of the biggest reasons why I like Ogre3d - it does all this (and lots more) out of the box. Not an option for spring, though.
User avatar
Otherside
Posts: 2296
Joined: 21 Feb 2006, 14:09

Post by Otherside »

this could be the best lua script ever keep it up looking good :D
User avatar
Pendrokar
Posts: 658
Joined: 30 May 2007, 10:45

Post by Pendrokar »

Kinda like Nexus: The Jupiter Incident!
User avatar
[XIII]Roxas
Posts: 182
Joined: 20 Jun 2007, 23:44

Post by [XIII]Roxas »

Bravo! This looks very promising.

One question: With Collision-Box problems, how will you keep the turrets *steadily* on the parent ship? Firebase?
User avatar
REVENGE
Posts: 2382
Joined: 24 Aug 2006, 06:13

Post by REVENGE »

Very cool zpock, although I would personally like to see this in Total Battletech. That would make mod of the year.
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

I don't think it will see a release this year, but agreed. Would be cool to switch between some premade weapon/engine/heatsink/armor/etc configurations. Fully customizable might be a bit over top if you considering the amount of user interaction needed.
User avatar
Zpock
Posts: 1218
Joined: 16 Sep 2004, 23:20

Post by Zpock »

I have learnt the basics of using shaders, and this is the result so far:

Image

There's a lot of possibilites, like adding a rippling effect:

Image

If anyone has examples of a really good shield effects (movies, games, still pictures), that would be nice to see.
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

Try a distortion shader combined with a transparent spark texture and a fade out.
User avatar
Zpock
Posts: 1218
Joined: 16 Sep 2004, 23:20

Post by Zpock »

Experimenting with LUA graphics, lightning weapon.

Image
User avatar
Maelstrom
Posts: 1950
Joined: 23 Jul 2005, 14:52

Post by Maelstrom »

Win much? :shock:
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6241
Joined: 29 Apr 2005, 01:14

Post by FLOZi »

Zpock: bigger than jesus.
User avatar
Snipawolf
Posts: 4357
Joined: 12 Dec 2005, 01:49

Post by Snipawolf »

It LOOKS nice, but how well does it perform? Is each its own weapon, or are they all synced to a single origin? Do they spread or is it shooting more towards the screen? Is it multiple weapons, or one? I'm guessing you can specify a custom texture. I don't see any repeating patterns, so I am guessing the engine/lua renders all of it...
User avatar
Zpock
Posts: 1218
Joined: 16 Sep 2004, 23:20

Post by Zpock »

It LOOKS nice, but how well does it perform? Is each its own weapon, or are they all synced to a single origin? Do they spread or is it shooting more towards the screen? Is it multiple weapons, or one? I'm guessing you can specify a custom texture. I don't see any repeating patterns, so I am guessing the engine/lua renders all of it...
The screenshot is taken in a sort of first person type of view in between the shooter/target. It's 5 weapons firing at the same time. It's a combination of texture and semi billboarded randomly generated geometry using simple (well, relatively speaking...) but clever math. LUA is awesome since you can do pretty much anything... There's a lot of room for improvements and fine tuning. For example forking and animation.

Gameplay wise this is probably going to be a pretty rare endgame type godly weapon with several drawbacks but offering the best choice for doing a lot of damage at once...
User avatar
Snipawolf
Posts: 4357
Joined: 12 Dec 2005, 01:49

Post by Snipawolf »

Alright, sounds great to me, then :twisted:
Post Reply

Return to “Lua Scripts”