DEFCON source code available

General discussion about Defcon

Moderator: Defcon moderators

User avatar
smc
level1
level1
Posts: 21
Joined: Sun Jun 13, 2010 2:18 am

DEFCON source code available

Postby smc » Wed Nov 30, 2011 12:04 am

Don't see this on the forum anywhere else!

...but the source for DEFCON is available via the new Humble Bundle (for a pittance fee):

http://www.humblebundle.com/

(Nice going Introversion)

cheers

smc
User avatar
jon
level4
level4
Posts: 537
Joined: Sun Mar 06, 2011 10:15 pm
Location: London
Contact:

Postby jon » Thu Dec 01, 2011 8:52 am

That is cool. Someone could find out where the Pac line bug comes from!
User avatar
trickser
level5
level5
Posts: 1826
Joined: Thu Mar 06, 2008 2:15 pm
Location: The Senate ; GMT+1
Contact:

Postby trickser » Thu Dec 01, 2011 10:13 am

I know since I tried to figure the nuke-path formula.
Defcon coordinates are similar to earth ones. Longitutes go from -180 to +180. The date border in mid pacific is the -180/+180 line. But Defcon will also take bigger numbers then 180. On the map +190 or -170 are on the same line.

If you are on the plus side and order a nuke to go beyond the date border its target coordinates will be still postive. e.g. +190.
Thats because of pythagoras, the standard solution to calculate distances: a²+b²=c². The solution to squareroot(4) can be either 2 or -2. So you always have to take care what result you expect.

So when the nuke crosses the date border the coordinates of its actual position chance from + to -. To compensate for this the target position will be shifted by 360, e.g from +190 to -170.

So far Defcon works fine.

The bug appears if you launch a nuke from one side of the date border to the same side, but have the path cross the border. I guess Defcon will not shift the target by 360, because its in the +180, -180 range. Then the nuke tries to travel from -180 to e.g +175. Its a giant bow and because the nukes actually speed is proportional to the size of the bow it accelerates to an insane speed.

Here is a rec for illustration: http://sfcon.demoszenen.de/dcrec/specia ... me-4.dcrec

EDIT: Well smth like that, on a 2nd thought the squarerooting itself might not have much to do with it. /EDIT

btw thanks for the OP, almost missed the source-code release.
User avatar
Zorotama
level5
level5
Posts: 1507
Joined: Thu Nov 13, 2008 4:03 am
Location: 64x80

Postby Zorotama » Thu Dec 01, 2011 1:09 pm

trickser wrote:I know since I tried to figure the nuke-path formula.
Defcon coordinates are similar to earth ones. Longitutes go from -180 to +180. The date border in mid pacific is the -180/+180 line. But Defcon will also take bigger numbers then 180. On the map +190 or -170 are on the same line.

If you are on the plus side and order a nuke to go beyond the date border its target coordinates will be still postive. e.g. +190.
Thats because of pythagoras, the standard solution to calculate distances: a²+b²=c². The solution to squareroot(4) can be either 2 or -2. So you always have to take care what result you expect.

So when the nuke crosses the date border the coordinates of its actual position chance from + to -. To compensate for this the target position will be shifted by 360, e.g from +190 to -170.

So far Defcon works fine.

The bug appears if you launch a nuke from one side of the date border to the same side, but have the path cross the border. I guess Defcon will not shift the target by 360, because its in the +180, -180 range. Then the nuke tries to travel from -180 to e.g +175. Its a giant bow and because the nukes actually speed is proportional to the size of the bow it accelerates to an insane speed.

Here is a rec for illustration: http://sfcon.demoszenen.de/dcrec/specia ... me-4.dcrec

EDIT: Well smth like that, on a 2nd thought the squarerooting itself might not have much to do with it. /EDIT

btw thanks for the OP, almost missed the source-code release.


THE RULE :!:
User avatar
jon
level4
level4
Posts: 537
Joined: Sun Mar 06, 2011 10:15 pm
Location: London
Contact:

Postby jon » Thu Dec 01, 2011 1:19 pm

Great thread :D

So does the source code release raise the prospect of a community edition defcon with bug fixes and tweaks, as long as IV get paid in the end?

My favourite quick change would be to sort the colours: yellow and orange are way too similar and blue is terrible :D
zoros dog
level2
level2
Posts: 146
Joined: Sun Sep 19, 2010 3:14 pm

Postby zoros dog » Thu Dec 01, 2011 5:25 pm

so does this mean someone can fix the bugs and release a version (a mod) that we can all play?
Alexsey
level0
Posts: 9
Joined: Mon Jul 26, 2010 11:25 pm

Postby Alexsey » Thu Dec 01, 2011 6:36 pm

zoros dog wrote:so does this mean someone can fix the bugs and release a version (a mod) that we can all play?


yes while it depends at original game files.
User avatar
bert_the_turtle
level5
level5
Posts: 4795
Joined: Fri Oct 13, 2006 6:11 pm
Location: Cologne
Contact:

Postby bert_the_turtle » Thu Dec 01, 2011 7:50 pm

And clients with the bugs fixed will be incompatible with the regular clients. Unless, of course, the bugfixes get integrated back and an official update is made.
User avatar
-- Tobias --
level3
level3
Posts: 360
Joined: Mon Mar 07, 2011 8:39 am

Postby -- Tobias -- » Sat Dec 03, 2011 6:52 am

What does this mean? Will someone be able to make changes, create new licensed (?) versions, etc.

(For anyone with wild-eyed ambitions for Defcon, I refer you to a previous post of mine for what I naively consider easy-to-accomplish enhancements - http://forums.introversion.co.uk/defcon ... ght=empire )



trickser wrote:I know since I .... 2nd thought the squarerooting itself might not have much to do with it.


Trickser has a nice player personality: the combination of a strong scientific understanding of Defcon along with a decent :wink: grasp of Defcon strategy. In real life, he should be monitored closely.
User avatar
bert_the_turtle
level5
level5
Posts: 4795
Joined: Fri Oct 13, 2006 6:11 pm
Location: Cologne
Contact:

Postby bert_the_turtle » Sat Dec 03, 2011 12:07 pm

-- Tobias -- wrote:What does this mean? Will someone be able to make changes, create new licensed (?) versions, etc.
We can make as many new versions as we like, but if a bug like the nuke path or the missing shots when you manually target AA fire gets fixed, that changes the physics, and physics changes cause desyncs if they only are active on one client. All clients need to have the fix for it to work. So, possibilities:
- We just fix the bugs, distribute builds, and set up servers that only allow fixed clients to join. This limits the audience for those servers.
- We fix the bugs but make it so that the fix is optional and only gets activated if all clients in a game have the fix. Since there will be many non-fixed clients still around, this will mean the fix will be only active in few games, and unpredictably so.
- We fix the bugs and IV take over our fixes in an official update. There would still be unfixed clients out there, but they'd be notified that they're outdated on the main screen.
Alexsey
level0
Posts: 9
Joined: Mon Jul 26, 2010 11:25 pm

Postby Alexsey » Sat Dec 03, 2011 5:21 pm

bert_the_turtle wrote:- We fix the bugs but make it so that the fix is optional and only gets activated if all clients in a game have the fix. Since there will be many non-fixed clients still around, this will mean the fix will be only active in few games, and unpredictably so.


Impossible since source code version not compatible (different version tags) with official versions (steam, etc). And making it compatible restricted by EULA.
User avatar
Tom.K
level1
level1
Posts: 63
Joined: Sat Dec 26, 2009 9:15 am
Location: The Universe / Milky Way / Solar System / Earth / Europe / Croatia

Postby Tom.K » Sat Dec 03, 2011 5:30 pm

Alexsey wrote:
bert_the_turtle wrote:- We fix the bugs but make it so that the fix is optional and only gets activated if all clients in a game have the fix. Since there will be many non-fixed clients still around, this will mean the fix will be only active in few games, and unpredictably so.


Impossible since source code version not compatible (different version tags) with official versions (steam, etc). And making it compatible restricted by EULA.


This changes your theory at some point:
- We fix the bugs and IV take over our fixes in an official update. There would still be unfixed clients out there, but they'd be notified that they're outdated on the main screen.


IV has full rights to change EULA and change it no matter what. If there's something what you can't do because of EULA, IV can be contacted and future actions will or will not be taken.
Spybot-S&D 2.0 Alpha Tester
User avatar
jon
level4
level4
Posts: 537
Joined: Sun Mar 06, 2011 10:15 pm
Location: London
Contact:

Postby jon » Sat Dec 03, 2011 8:43 pm

Fixed pathfinding: that is the dream
zoros dog
level2
level2
Posts: 146
Joined: Sun Sep 19, 2010 3:14 pm

Postby zoros dog » Sat Dec 03, 2011 10:55 pm

weps save us pls :(
User avatar
xander
level5
level5
Posts: 16869
Joined: Thu Oct 21, 2004 11:41 pm
Location: Highland, CA, USA
Contact:

Postby xander » Sat Dec 03, 2011 11:20 pm

jon wrote:Fixed pathfinding: that is the dream

One does not really need the source code to make some major improvements to the pathfinding. Generally, DGs will go straight to their destination. However, if they cannot follow a straight path, they will go first to a travel node, which is an invisible building on the map. Then they will travel via the network of nodes to the node closest to their destination, and try to follow a straight line from there to their destination. By editing the maps, you can significantly improve pathfinding. However, as with any source mod, you would also need to ensure that every player has the same version of the map.

xander

Return to “General”

Who is online

Users browsing this forum: No registered users and 5 guests