New weapons

11 replies [Last post]
stymek
User offline. Last seen 15 years 28 weeks ago. Offline
Joined: 2008-09-06
Posts: 7

hi.

first: the game is cool. really. i really enjoy it, the main features are just finished and working. bravo!

second: i looked in the code, and i would like to play with adding a weapon. did you make any tutorial on howto do it? in the code there is not so much comments, and it is probably easy to skip sth.

btw. for future release (2.0 ;] ). it would be great, to have a kind of separate specification of weapons (e.g. like with maps). currently it is really tricky to do anything.

ok. this is for it.

unC0Rr
unC0Rr's picture
User offline. Last seen 1 year 5 weeks ago. Offline
Joined: 2006-11-27
Posts: 576

It's really hard patch engine, as it should be done with special care, or you risk tp break at least network game introducing some time issues. There's no any documentation, and I'm not willing to make one.

stymek
User offline. Last seen 15 years 28 weeks ago. Offline
Joined: 2008-09-06
Posts: 7

yeah.. i just looked closer.. i managed to change some weapon specific properties (e.g. strength of different explosives). now i play with UFO just to test it. do you really think that keeping all suchconstants in code can not be changed? they can be at least extracted outside to your uConst.pas.. and the best would be to have an external file with all the specification. i know it is a lot of stupid work (like better names, parsing the file, etc.) but it will allow for easier modification of weapons. for example u can imagine making the uzi like weapon by aplying 20 times the 20 times weaker desert eagle (maybe with some random angle).. and in the theory it should not require changing the code (which is not possible with current approach). what do you mean by destroying the net code? i did not look there, so is it possible to explain it in short how does it work? i mean only principles. how did you managed with demage propagation? if i will have a hacked version of game with different explosion radius for a granade, how would it behave if i will play on sb. server? thanks for all answers. really, this game is a pice of good work!! and btw. why do you use some values coded as _Shocking01? what does it change? is it a macro, fp convention, or sth else?

unC0Rr
unC0Rr's picture
User offline. Last seen 1 year 5 weeks ago. Offline
Joined: 2006-11-27
Posts: 576

Well, you may change constants, there's most probably no problem with them, but if you change code, you may accidentaly desynchronize code execution flow on different network clients, so it would be impossible to play via network. And if you change something, those change must be applied on every client, even if it's just a line of code, or one constant. So I see no reason to give everyone an opportunity to change any engine settings and thus to break the engine. If you change anything, you make incompatible game's version not only for network playing, but also for demos playing and game saving.
As for values coded like _Shocking01, you may take a look at uFloat.pas - it's actually fixed-point arithmetics, which I had to invent specially for net game.

stymek
User offline. Last seen 15 years 28 weeks ago. Offline
Joined: 2008-09-06
Posts: 7

OK. i tried some tricks. i have the following questions:

1. the hwFloat: why was it necessary to introduce it? do you have any random(range) which returns hwFloat (i assume that not, but maybe i skipped sth.)?

2. i try to learn sth. by changing your code. so i tried to make a shotgun based on desert eagle (for the moment i change desert eagle to avoid changing all the picutres, menues, etc). the idea is that instead of 4 consecutive bullets you shoot e.g. 10 parallel ones, with little error in angle. so to do that i modify your HHHandlers.inc and in case of DE i write:
amDEagle: begin
AddGear(hwRound(X + xx * cHHRadius), hwRound(Y + yy * cHHRadius), gtDEagleShot, 0, xx *_0_8* _0_5, yy * _0_5, 0);
AddGear(hwRound(X + xx * cHHRadius), hwRound(Y + yy * cHHRadius), gtDEagleShot, 0, xx * _0_5, yy *_0_8* _0_5, 0);
AddGear(hwRound(X + xx * cHHRadius), hwRound(Y + yy * cHHRadius), gtDEagleShot, 0, xx *_0_9* _0_5, yy * _0_5, 0);
AddGear(hwRound(X + xx * cHHRadius), hwRound(Y + yy * cHHRadius), gtDEagleShot, 0, xx * _0_5, yy *_0_9* _0_5, 0);
AddGear(hwRound(X + xx * cHHRadius), hwRound(Y + yy * cHHRadius), gtDEagleShot, 0, xx *_0_87* _0_5, yy *_0_9* _0_5, 0);
AddGear(hwRound(X + xx * cHHRadius), hwRound(Y + yy * cHHRadius), gtDEagleShot, 0, xx * _0_9*_0_5, yy *_0_87* _0_5, 0);
AddGear(hwRound(X + xx * cHHRadius), hwRound(Y + yy * cHHRadius), gtDEagleShot, 0, xx *_0_84* _0_5, yy *_0_9* _0_5, 0);
AddGear(hwRound(X + xx * cHHRadius), hwRound(Y + yy * cHHRadius), gtDEagleShot, 0, xx *_0_9* _0_5, yy *_0_84* _0_5, 0);
AddGear(hwRound(X + xx * cHHRadius), hwRound(Y + yy * cHHRadius), gtDEagleShot, 0, xx * _0_5, yy * _0_5, 0);
end;

(i know, it is not the best it can be, if the angle is close to k*pi/4. all bullets are having almost the same trace, etc., but i jjust test the idea). so i have the following problem with this:
1. i am sure that sometimes more then 2 bullets hit the guy. however, the max score i got are 2 hits. is it by any chance like this that the close gears are anihilating themselves? if not what is happening??
2. even if the guy is hit twice (two times 7 appears) his health goes only by one hit (7 instead 14). why is it so??

thanks for help and answers.

unC0Rr
unC0Rr's picture
User offline. Last seen 1 year 5 weeks ago. Offline
Joined: 2006-11-27
Posts: 576

Because it gets hit only once... If the hedgehog is moving, it will not be hit, and it will start to move with the first hit.

stymek
User offline. Last seen 15 years 28 weeks ago. Offline
Joined: 2008-09-06
Posts: 7

and way it is not hit while it is moving? to avoid hitting with the same gear again??

unC0Rr
unC0Rr's picture
User offline. Last seen 1 year 5 weeks ago. Offline
Joined: 2006-11-27
Posts: 576

yep

stymek
User offline. Last seen 15 years 28 weeks ago. Offline
Joined: 2008-09-06
Posts: 7

so maybe it is better idea to add a list of hedgehog affected by a gear, and every time something should happen (in each step of "do.." procedure) you test if the hedgehog is not on the already affected list??

ps still i do not understand the reasons to use such a custom arithmetics, please say sth more explicite then "required for network play".. it is due to different precision and posible desynchronization of different clients (e.g. win/lin or 32/64)??

thanks a lot/.

unC0Rr
unC0Rr's picture
User offline. Last seen 1 year 5 weeks ago. Offline
Joined: 2006-11-27
Posts: 576

yes

Sonida
User offline. Last seen 15 years 33 weeks ago. Offline
Joined: 2008-09-08
Posts: 1

I recently got my grubby little hands on this cool game and have been whoring it out as much as i can! I like the melee weapons available, but I was wondering, why dont they have much cooler sound effects? I would like it if in the next release the baseball bat could have the Smash Bros. baseball bat 'smash' sound, if u catch my drift, and the whip should have that whip cracking sound, u know. Maybe u could add those little perks on ur next release, just my ideas.

Uriah
Uriah's picture
User offline. Last seen 11 years 35 weeks ago. Offline
Joined: 2008-01-25
Posts: 359

We have no sound engineer at the moment.

User login

Copyright © 2004-2024 Hedgewars Project. All rights reserved. [ contact ]