Originally posted by bfg666
View Post
Announcement
Collapse
No announcement yet.
2d sprites replacing models help
Collapse
X
-
-
Originally posted by Seven View PostI only had to adjust its origin coordinate a little bit forward that you can actually see it in-game (as you know view weapon have a specific offset that they appear wher they appear in-game).
Thanks!Last edited by ayyynn; 09-25-2016, 02:58 PM.
Comment
-
Originally posted by ayyynn View Post♪ I'm skiiiiiiinnin' in the pain, just skiiiiiiinnin' in the pain ♪
♪ What a glorious feelin' I'm haaaaaaappy again ♪
Comment
-
Some news. I still couldn't make it work with just replacing the .mdl file with a sprite. But I have stolen the quake wolf 3d port v_weapon .mdl file and attached a png file to it. It's working pretty good and as i'm using a 3d file of a square plane, i get some lighting effect on the weapon.
(shotgun from doom2016)
Now i'll need to study how to animate all of this!
In the wolf3d port code source, I understand that there is 1 v_weapon.mdl (+v_weapon.mdl_x.tga) file per animation frame. (like v_auto_0.mdl ; v_auto_1.mdl ; v_auto_2.mdl ; etc.. ). I don't know if it's the good way to go, it seems strange to me to load a new 3d model each frame!
maybe this is a bit of the code related to animation :
Code:/* ============ W_Attack An attack impulse can be triggered now ============ */ void() player_knife1; void() player_pistol1; void() player_auto1; void() player_chain1; void() W_Attack = { local float r; if (!W_CheckNoAmmo ()) return; makevectors (self.v_angle); // calculate forward angle for velocity self.oframe = -1; if (self.weapon == IT_KNIFE) { if (self.button0held) return; self.button0held = 1; sound (self, CHAN_WEAPON, "lsfx/023.wav", 1, ATTN_NORM); player_knife1 (); self.attack_finished = time + 0.3428; } else if (self.weapon == IT_PISTOL) { if (self.button0held) return; self.button0held = 1; self.show_hostile = time + 1; // wake monsters up player_pistol1 (); self.attack_finished = time + 0.3428; } else if (self.weapon == IT_MACHINEGUN) { self.show_hostile = time + 1; // wake monsters up self.attack_finished = time + 0.1714; player_auto1 (); } else if (self.weapon == IT_CHAINGUN) { self.show_hostile = time + 1; // wake monsters up self.attack_finished = time + 0.1714; player_chain1 (); } }; /* ============ W_WeaponFrame Called every frame so impulse events can be handled as well as possible ============ */ void() W_WeaponFrame = { if (time < self.attack_finished) return; ImpulseCommands (); // check for attack if (self.button0) W_Attack (); else self.button0held = 0; };
Last edited by ayyynn; 09-26-2016, 08:05 AM.
Comment
-
Originally posted by ayyynn View PostI think this is were i'm stuck. I tried to change the X/Y coordinates in FIMG but it don't seems to work. Should I add another property like "Origin Z" through frame properties advanced tab?
Thanks!
a sprite is flat. It is just a 2D picture. If you want to move a sprite in a world you have to change its origin. So, moving it forward for view weapons can only be done via qc.
I have good news for you:
I have the source code for the RetroBlazer TC and you can now study how its author did the weapon sprites.
Originally posted by ayyynn View PostSome news. I still couldn't make it work with just replacing the .mdl file with a sprite. But I have stolen the quake wolf 3d port v_weapon .mdl file and attached a png file to it. It's working pretty good and as i'm using a 3d file of a square plane, i get some lighting effect on the weapon.
That would be a pity, now that you are so close....
Originally posted by ayyynn View PostNow i'll need to study how to animate all of this!
In the wolf3d port code source, I understand that there is 1 v_weapon.mdl (+v_weapon.mdl_x.tga) file per animation frame. (like v_auto_0.mdl ; v_auto_1.mdl ; v_auto_2.mdl ; etc.. ). I don't know if it's the good way to go, it seems strange to me to load a new 3d model each frame!
You will want to use model frames instead of multiple models for its animation, yes.
Originally posted by ayyynn View Postmaybe this is a bit of the code related to animation :
It checks which weapon you are equipped with and start the corresponding actions.
Follow the code further and you will find the animation part.
But as mentioned, the original 1.06 Quake source is almost identical and is good for learning, as you know weapon behaviour in-game and can therefore quickly learn what each function does.
You inspired me with your sprite weapons idea and I converted the RetroBlazer shotgun and Blood�s pitchfork into regular Quake
It works quite good. Here is a short clip in action
(do not complain about Blood�s pitchfork texture, it is only 8-bit)
[ame]http://www.youtube.com/watch?v=QSTGg9_xI3M[/ame]
Happy coding,
Seven
Comment
-
Originally posted by Seven View PostHello ayyynn,
a sprite is flat. It is just a 2D picture. If you want to move a sprite in a world you have to change its origin. So, moving it forward for view weapons can only be done via qc.
I found your "Adjustable view_weapon positions and idle animations for Quake" mod when i was lost through your amazing list of work at quaketastic!
It's working now, but needs some adjustments!
Originally posted by Seven View PostI have good news for you:
I have the source code for the RetroBlazer TC and you can now study how its author did the weapon sprites.
Can't wait to dig in that code! Are you in relation with the Retroblazer team? Any news about their project?
Originally posted by Seven View PostSo did you scrap your idea of using sprites as weapons already ? And want to use standard .mdl now ?
That would be a pity, now that you are so close....
Well, if you want to stay with regular .mdl weapons, the original source code of Quake tells you everything you need to know. As well as every mod that uses custom weapons if you need more examples.
You will want to use model frames instead of multiple models for its animation, yes.
Originally posted by Seven View PostYou inspired me with your sprite weapons idea and I converted the RetroBlazer shotgun and Blood�s pitchfork into regular Quake
It works quite good. Here is a short clip in action
(do not complain about Blood�s pitchfork texture, it is only 8-bit)
http://www.youtube.com/watch?v=QSTGg9_xI3MLast edited by ayyynn; 09-27-2016, 08:59 AM.
Comment
-
Mmh it's working good with the digitized sprite style, and a local friend video artist got some tools to make it right! I'll maybe go this way!
Sprite done with phone camera - 5 frames - quick chopping.
[ame]http://www.youtube.com/watch?v=_6rYmPamNJM[/ame]
Comment
-
[ Slightly off topic question ]
As I was thinking about drawing sprites for monsters and ennemies, I discovered "Spine" a while ago. It's a 2D skeletal animation tool. With it you can "easely" animate a character out of a well organised 2d drawing.
One of it's features is the integration in game engines so you do not necessarily have to render each frame and then build a sprite animation.
showreel
[ame]http://www.youtube.com/watch?v=VreetwYUqog[/ame]
about libraries and integration in game engines : Spine: Runtimes
I don't know if it's really necessery but for curiosity purposes, could it be possible to include such runtime into darkplaces?
Comment
-
-
https://www.youtube.com/watch?v=4fRDytfM9yY
Comment
-
Originally posted by ayyynn View PostHehe in the exact opposite, have you heard of "total chaos" TC for doom [email protected]? It looks amazing...
https://www.youtube.com/watch?v=4fRDytfM9yY
awesome work , aniway i wanna see guns beating these monstersseems inspired in dying light combats and camera
the invasion has begun! hide your children, grab the guns, and pack sandwiches.
syluxman2803
Comment
-
Originally posted by ayyynn View PostI found your "Adjustable view_weapon positions and idle animations for Quake" mod when i was lost through your amazing list of work at quaketastic!
A lot of people complain about misaligned/positioned Quake view weapon models when changing FOV and/or screen resolution. With this mod you can position & tilt them wherever you want. You can also have any weapon right handed like in Quake 3 if you prefer.
I never thought that it might come in handy for bringing sprite weapons into Quake. LOL
Originally posted by ayyynn View Post
Can't wait to dig in that code! Are you in relation with the Retroblazer team? Any news about their project?
Originally posted by ayyynn View PostYour reply was like giving me a boost to stay with thoses lovely sprites!
===================================
I think my work here is done. You are experienced enough to continue from here.
Maybe one more thing:
You surely have noticed that sprites are always FULLBRIGHT in the game Quake. You say you are using Darkplaces, so you can make (and should !) make use of its extension: DP_LITSPRITES
So that lighting on sprites is enabled !
The only thing you need to do is to add: ! in front of the sprites name. So:
!v_shot.mdl instead of v_shot.mdl
But you need to add the ! inside of the qc as well.
The result will be correct weapon lighting behaviour like with regular models.
Here is a quick comparism of this feature disabled (beginning of clip) and enabled (end of clip):
[ame]http://www.youtube.com/watch?v=eY6sWkNrrbE[/ame]
One last word:
What I like the most about sprites compared to models is that they are much much more detailed and animations are by far superior looking. You can simply add so much more effects via the texture itself compared to models & particles, that sprites are much nicer in this regards.
The downside is of course when you want to use world sprites (not HUD sprites) that you have to use a more complex code for their fake "angles" and you will always only see 4 "sides" of a world sprite... So I prefer models for the world.
But you now have the Retroblazer code and it tells you exactly how to handle world sprites like monsters !
Here is an amazing fantasy-weapon sprite I just found (a little bit like the mage in Hexen):
... Seven goes back to sprite animation now ...
Best of luck with your ambitious project !
Kind regards,
SevenLast edited by Seven; 09-27-2016, 11:26 AM.
Comment
-
Originally posted by ayyynn View PostHehe in the exact opposite, have you heard of "total chaos" TC for doom [email protected]? It looks amazing...
https://www.youtube.com/watch?v=4fRDytfM9yY
Starter Pack's Hell on Earth
Halodoom
WolfenDoom: Blade of Agony
Now this. It's amazing what modders can make.
Comment
-
I have the source code for the RetroBlazer TC
Comment
-
Originally posted by KillPixel View PostMay I get that from you? I'm having difficulty finding it elsewhere.
You will not find it elsewhere, because it was not released to public.
That is why I do not post it here.
I know you are working on a new sprite game/mod. If you are interested you can look into your pm. But please be nice and do not release it.
Best wishes,
Seven
Comment
Comment