Safe JK2 source code

Discussions about modding, questions, mod requests or just show off what you're working on.
User avatar
ouned
Administrator
Posts: 596
Joined: 23 Feb 2015, 13:03
Location: Gliese581c

Re: Safe JK2 source code

Post by ouned »

that's the problem.. it only compiles with mingw^^
no option for us
fau wrote:It's noticeably different across various mods and apparently big code changes make it more pronounced.
placebo. :D
User avatar
fau
Staff
Posts: 433
Joined: 16 Aug 2015, 01:01
Location: Warsaw / Poland
Contact:

Re: Safe JK2 source code

Post by fau »

ouned wrote:placebo. :D
I don't know a single decent NFer who would agree. And I know hundreds of them. Also it's not the matter of "this slash should go through", it's more of a statistical observation - eg your predictions about enemy's hp are completely off when switching mods.
Haven't investigated causes of this. Maybe you could come up with some ideas?
Kevin
Administrator
Posts: 393
Joined: 07 Jun 2015, 08:36

Re: Safe JK2 source code

Post by Kevin »

fau wrote:
ouned wrote:placebo. :D
I don't know a single decent NFer who would agree. And I know hundreds of them. Also it's not the matter of "this slash should go through", it's more of a statistical observation - eg your predictions about enemy's hp are completely off when switching mods.
Haven't investigated causes of this. Maybe you could come up with some ideas?
I once hosted a NF server running a mod, where I deactivated all the cvar's and renamed the mod to basejk - nobody could tell it wasn't basejk.

Quite sure it is just your imagination being like "This isn't basejk so something must be broken" ^^ Damage remains the same too; tested that a few times because people claimed otherwise :)
User avatar
ouned
Administrator
Posts: 596
Joined: 23 Feb 2015, 13:03
Location: Gliese581c

Re: Safe JK2 source code

Post by ouned »

fau wrote:eg your predictions about enemy's hp are completely off when switching mods.
Haven't investigated causes of this. Maybe you could come up with some ideas?
That would be a topic for @Daggolin or @Boothand, I'm more the "system programmer" type. Didn't even touch the cgame/game for years.

But what I can tell you about JK2's saber system is that it is actually broken everywhere. (+basejk)
do you know the bug where you only loose 1 HP after a red saber attack? (only happens if you had 100/100 from my experience)
obviously this bug is extremely affecting gameplay and no one ever complained about it.
User avatar
Boothand
Administrator
Posts: 986
Joined: 24 Feb 2015, 08:21
Contact:

Re: Safe JK2 source code

Post by Boothand »

I know for sure, Daggolin too, that the DARK server sometimes has its 'moments'. Daggo can say more about this, but it has a lot to think about, so to speak. Mods in general are not like this, but Twimod which by now is very feature packed and kind of worn by just mere... size, can allow pretty weird stuff to happen on that server.

I haven't noticed it in a while, but it did affect saber gameplay, although I don't know about damage, I highly doubt that. Passthroughs mainly. But yeah, haven't noticed that in many months, and all other mods I've tried haven't had any quirks affecting combat.
User avatar
fau
Staff
Posts: 433
Joined: 16 Aug 2015, 01:01
Location: Warsaw / Poland
Contact:

Re: Safe JK2 source code

Post by fau »

fau wrote:Quite sure it is just your imagination being like "This isn't basejk so something must be broken" ^^ Damage remains the same too; tested that a few times because people claimed otherwise :)
Damage is the same. This is why I'm talking about blocks. How hard it is to put your opponent into "broken parry" animation and deal damage in various situations.
I learned to play on various mods over the years, in this order: academy, basejk, dsmod, league mod, dcmod and I like them all in their own way. Most NF players have their own mod path and they are gonna tell you the same. Each mod is different and requires readjusting your style - some moves that break your opponent's block don't work so you need to change or stop doing them, some types of clashes/exchanges that used to work in your favor hp-wise now don't.

@ouned: No, I didn't know about 1hp bug. Any details? A lot of 1hp hits happen when you don't hit cleanly, I thought it's just when you get blocked and scorch your opponent for 1hp (like when not swinging saber at all), haven't noticed anything like that when attacking disarmed player.
User avatar
ouned
Administrator
Posts: 596
Joined: 23 Feb 2015, 13:03
Location: Gliese581c

Re: Safe JK2 source code

Post by ouned »

Boothand wrote:I know for sure, Daggolin too, that the DARK server sometimes has its 'moments'. Daggo can say more about this, but it has a lot to think about, so to speak. Mods in general are not like this, but Twimod which by now is very feature packed and kind of worn by just mere... size, can allow pretty weird stuff to happen on that server.
- [DARK]Twimod doesn't even compile as a native binary
- It's not even public
- He had to fix variable initialization in weird places when using it with JK2MV because they depended on undefined behavior
- Daggolin calls it a hell of a mess by himself
- It's based on Twimod which was made by a retarded version of ouned
We shouldn't bring "experimental" mods into the discussion :D
fau wrote:Damage is the same. This is why I'm talking about blocks. How hard it is to put your opponent into "broken parry" animation and deal damage in various situations.
I learned to play on various mods over the years, in this order: academy, basejk, dsmod, league mod, dcmod and I like them all in their own way.
Are you sure that your comparison is valid? Because, obviously, if you play on a server on which you have a ping of say 40 everything feels more correct then on a server on which you have a ping of 120.

I'm looking to this issue from a developers point of view. I had very bad experience with the 1.04 CTF community when I introduced a mod which fixed some bugs, nothing more. People started to tell me how everything is different now and how shit the mod is. I then changed the mod's name to "basejk" and told them that I removed the mod, suddenly everything was alright, all complains gone. :lol:
User avatar
Daggolin
Administrator
Posts: 794
Joined: 23 Feb 2015, 13:05

Re: Safe JK2 source code

Post by Daggolin »

The topic of mods and their effects on gameplay is a pretty old one and there is no clear "facts".

The majority of people claim there is differences, but many theories rely on false assumptions. I remember good players who played the game for years tried to convince everyone that the most common mods are broken and their damage would be wrong. However those players used to play vulcanus adminmod (I think it was that one, sorry if I am wrong) on different settings (damage wise) leading to the false impression all the other mods have incorrect gameplay. Some of those people even insisted that today's base servers would all have wrong damage, because they would be running ds-online configs or similar as all hosts would have used ds-online at times.

Such people running around, trying to convince everyone about the changes have lead to a lot of false assumptions and impressions (for instance Kameleon refers to the damage when you talk about gameplay changes, as most people told him the damage in his mod would be wrong), as well as modders simply ignoring most complaints about gameplay.

As Kameleon and ouned just mentioned an example of a mod being renamed to basejk and people not noticing it I would like to mention, that I have already seen the inverse test where a basejk server was labeled as a mod and people started complaining within a day. Those examples show how much "placebo" contributes to the gameplay differences, but they also show that you don't have any "real" way to measure the mod's influence on the gameplay (as ping, client fps, server fps, ... influence gameplay as well).

I do have the feeling that some mods "play different" than others, but I couldn't meassure a "real difference", nor look at the code of "outstanding mods", as most of them are closed source. It could be that mods influence gameplay in different ways, but due to the above reasons I don't think we have a proper way of analysing or preventing the issues (if they are even real).

ouned wrote:
Boothand wrote:I know for sure, Daggolin too, that the DARK server sometimes has its 'moments'. Daggo can say more about this, but it has a lot to think about, so to speak. Mods in general are not like this, but Twimod which by now is very feature packed and kind of worn by just mere... size, can allow pretty weird stuff to happen on that server.
- [DARK]Twimod doesn't even compile as a native binary
- It's not even public
- He had to fix variable initialization in weird places when using it with JK2MV because they depended on undefined behavior
- Daggolin calls it a hell of a mess by himself
- It's based on Twimod which was made by a retarded version of ouned
We shouldn't bring "experimental" mods into the discussion :D
As I keep summarizing it up: "It's a mess". When I started working on the old Twimod code from ouned (or that old version of ouned) back in 2009 I didn't have programming experience. I didn't know what an integer, a char, an array or a pointer were. I just started learning by doing, reading no tutorials. I guess you can imagine how parts of the code look. Full of bugs and security holes (there is even a way for connecting clients to change the map). I somehow got it into a state where normal use seems not to cause trouble, but as soon as an admincommand is used... That's also the reason why it's closed source and not released. I would really like to completly replace the mod on [DARK] with a new mod, but I barely even got the time to finish the mvsdk (which some of the people here are waiting for).

For an example of weird code (not security-hole weird, just bad old code) click "Show". :oops:
I just opened the code and picked a random thing I think I did in 2009. Look at this mess of code! (Lots of code duplication, if-statements that check if something is 1 that has been checked for 0 in surrounding if-statements, ...)

Code: Select all

	if (ent->client && ent->client->ps.weaponTime < 1)
	{
		if (twimod_dualblade.integer == 0)
		{
			if  (ent->client->sess.enabledualblade == qfalse)
			{
				if (ent->client->ps.saberHolstered)
				{
					ent->client->ps.saberHolstered = qfalse;
					G_Sound(ent, CHAN_AUTO, saberOnSound);
				}
				else
				{
					ent->client->ps.saberHolstered = qtrue;
					G_Sound(ent, CHAN_AUTO, saberOffSound);

					//prevent anything from being done for 400ms after holster
					ent->client->ps.weaponTime = 400;
				}
			}
			else if (ent->client->sess.enabledualblade == qtrue)
			{
				if (ent->client->ps.saberHolstered == qfalse && ent->client->ps.dualBlade == qfalse)
				{
					ent->client->ps.dualBlade = qtrue;
					if (twimod_dualblade.integer == 1)
					{
						ent->client->pers.dualBlade = qtrue;
					}
					G_Sound(ent, CHAN_AUTO, saberOnSound);
				}
				else if (ent->client->ps.saberHolstered)
				{
					ent->client->ps.saberHolstered = qfalse;
					G_Sound(ent, CHAN_AUTO, saberOnSound);
				}
				else if (ent->client->ps.saberHolstered == qfalse && ent->client->ps.dualBlade == qtrue)
				{
					ent->client->ps.saberHolstered = qtrue;
					ent->client->ps.dualBlade = qfalse;
					if (twimod_dualblade.integer == 1)
					{
						ent->client->pers.dualBlade = qfalse;
					}
					G_Sound(ent, CHAN_AUTO, saberOffSound);

					//prevent anything from being done for 400ms after holster
					ent->client->ps.weaponTime = 400;
				}
			}
		}
		if (twimod_dualblade.integer == 1)
		{
			if  (duel_disabledualblade.integer == 1 && ent->client->ps.duelInProgress && ent->client->sess.dualbladewhileduel)
			{
				if (ent->client->ps.saberHolstered)
				{
					ent->client->ps.saberHolstered = qfalse;
					G_Sound(ent, CHAN_AUTO, saberOnSound);
				}
				else if (ent->client->ps.saberHolstered == qfalse && ent->client->ps.dualBlade == qfalse)
				{
					ent->client->ps.dualBlade = qtrue;
					if (twimod_dualblade.integer == 1)
					{
						ent->client->pers.dualBlade = qtrue;
					}
					G_Sound(ent, CHAN_AUTO, saberOnSound);
				}
				else if (ent->client->ps.saberHolstered == qfalse && ent->client->ps.dualBlade == qtrue)
				{
					ent->client->ps.saberHolstered = qtrue;
					ent->client->ps.dualBlade = qfalse;
					if (twimod_dualblade.integer == 1)
					{
						ent->client->pers.dualBlade = qfalse;
					}
					G_Sound(ent, CHAN_AUTO, saberOffSound);

					//prevent anything from being done for 400ms after holster
					ent->client->ps.weaponTime = 400;
				}
			}
			else if  (duel_disabledualblade.integer == 1 && ent->client->ps.duelInProgress)
			{
				if (ent->client->ps.saberHolstered)
				{
					ent->client->ps.saberHolstered = qfalse;
					ent->client->ps.dualBlade = qfalse;
					G_Sound(ent, CHAN_AUTO, saberOnSound);
				}
				else
				{
					ent->client->ps.saberHolstered = qtrue;
					ent->client->ps.dualBlade = qfalse;
					G_Sound(ent, CHAN_AUTO, saberOffSound);

					//prevent anything from being done for 400ms after holster
					ent->client->ps.weaponTime = 400;
				}
			}
			else if  (ent->client->sess.disabledualblade == qfalse)
			{
				if (ent->client->ps.saberHolstered)
				{
					ent->client->ps.saberHolstered = qfalse;
					G_Sound(ent, CHAN_AUTO, saberOnSound);
				}
				else if (ent->client->ps.saberHolstered == qfalse && ent->client->ps.dualBlade == qfalse)
				{
					ent->client->ps.dualBlade = qtrue;
					if (twimod_dualblade.integer == 1)
					{
						ent->client->pers.dualBlade = qtrue;
					}
					G_Sound(ent, CHAN_AUTO, saberOnSound);
				}
				else if (ent->client->ps.saberHolstered == qfalse && ent->client->ps.dualBlade == qtrue)
				{
					ent->client->ps.saberHolstered = qtrue;
					ent->client->ps.dualBlade = qfalse;
					if (twimod_dualblade.integer == 1)
					{
						ent->client->pers.dualBlade = qfalse;
					}
					G_Sound(ent, CHAN_AUTO, saberOffSound);

					//prevent anything from being done for 400ms after holster
					ent->client->ps.weaponTime = 400;
				}
			}
			else if  (ent->client->sess.disabledualblade == qtrue)
			{
				if (ent->client->ps.saberHolstered)
				{
					ent->client->ps.saberHolstered = qfalse;
					G_Sound(ent, CHAN_AUTO, saberOnSound);
				}
				else
				{
					ent->client->ps.saberHolstered = qtrue;
					G_Sound(ent, CHAN_AUTO, saberOffSound);

					//prevent anything from being done for 400ms after holster
					ent->client->ps.weaponTime = 400;
				}
			}
		}
	}
I think this is an updated version of the above code (with additional changes for empower & allpowerful to behave a bit different):

Code: Select all

	if (ent->client && ent->client->ps.weaponTime < 1)
	{
		if ( ent->client->ps.saberHolstered )
		{
			ent->client->ps.saberHolstered = qfalse;
			G_Sound(ent, CHAN_AUTO, saberOnSound);
		}
		else if ( !ent->client->ps.dualBlade && (twimod_dualblade.integer || ent->client->sess.enabledualblade || ent->client->sess.empower || ent->client->sess.allpowerful) && !ent->client->sess.empowersb && !ent->client->sess.allpowerfulsb && !ent->client->sess.disabledualblade && (!ent->client->ps.duelInProgress || ent->client->sess.dualbladewhileduel) )
		{
			ent->client->ps.dualBlade = qtrue;
			G_Sound(ent, CHAN_AUTO, saberOnSound);
		}
		else
		{
			ent->client->ps.saberHolstered = qtrue;
			ent->client->ps.dualBlade = qfalse;
			G_Sound(ent, CHAN_AUTO, saberOffSound);

			//prevent anything from being done for 400ms after holster
			ent->client->ps.weaponTime = 400;
		}
	}
User avatar
fau
Staff
Posts: 433
Joined: 16 Aug 2015, 01:01
Location: Warsaw / Poland
Contact:

Re: Safe JK2 source code

Post by fau »

Lets not overexagerrate it. Mods aren't better or worse than each other or than basejk, they are just different. You can get used to it in few hours and it will feel completely natural in few days (although the power balance between players/styles may change). The problem arises when you've got servers on various mods and jumping between them on the same day. Most ppl just choose not to. I easily convinced all Polish players to switch from academy to league mod (I was hoping for old international tffa community to come back, worked only partially), just told them to give it few days to get used to it, they did and never complained again.

If there was a possibility to fix it in client (doubt it, unless it's eg some type conversion issue? These are pretty well covered in the vm interpreter though), it could help uniting community a little more. People don't want to go out of their comfort zone when they don't need to.
User avatar
Miso
Posts: 170
Joined: 24 Feb 2015, 02:41
Location: Massachusetts / United States

Re: Safe JK2 source code

Post by Miso »

NOT BASE CANT USE IT GG
Jj.miso
Post Reply
Created by Matti from StylesFactory.pl and Warlords of Draenor (modified by jk2.info)
Powered by phpBB® Forum Software © phpBB Limited