IRC logs for #opendune on OFTC at 2011-02-20
            
01:09:59 <glx> using some tricks I determined the bug is in Script_Unit_1319_002D()
03:02:02 <glx> http://svn.opendune.org/~glx/temp.patch works (yes I restart conversion of the function)
04:53:32 *** glx has quit IRC
12:40:46 *** fjb is now known as Guest2014
12:40:48 *** fjb has joined #openDune
12:48:02 *** Guest2014 has quit IRC
13:03:47 <DorpsGek> SVN: truebrain (r1334) -Add: C-ified Unit_HouseUnitCount_Remove()
13:04:25 <DorpsGek> SVN: truebrain (r1335) -Revert (r1323): stop committing your changed dune.cfg ffs (who is this TrueBrain anyway?)
13:08:10 <DorpsGek> SVN: truebrain (r1336) -Fix: 'beingBuilt' in fact is 'isOnMap', a bit more general
13:15:41 <Xaroth|Work> truefail? :P
13:15:59 <Xaroth|Work> TrueBrain: svn:ignore on dune.cfg? :o
13:16:15 <TrueBrain> I should, yes
13:16:17 <TrueBrain> I didn't, no
13:16:31 <Xaroth|Work> heh :P
13:17:15 <Xaroth|Work> somebody on tweakers is following openttd :P
13:17:16 *** glx has joined #openDune
13:17:16 *** ChanServ sets mode: +o glx
13:17:21 <Xaroth|Work> RC1 got tweakered :P
13:17:41 <glx> hello
13:17:55 <Xaroth|Work> o/
13:17:56 <TrueBrain> morning glx
13:18:01 <TrueBrain> I walked over that function again
13:18:05 <TrueBrain> couldn't find anything wrong :(
13:18:24 <glx> probably a break
13:18:36 <glx> there are too many loops there ;)
13:18:51 <glx> with external breaks inside inner loops
13:31:27 <DorpsGek> SVN: truebrain (r1337) -Add: C-ified House_UpdateCreditsStorage()
13:31:34 <TrueBrain> :D :D :D @ revision
13:31:47 <glx> hihi
13:52:26 <TrueBrain> I realised the 'beingBuilt' is more general :)
13:52:35 <TrueBrain> when something is being repaired and stuff, it is also true :)
14:40:59 <glx> found it I think
14:41:28 <TrueBrain> :D
14:43:44 <glx> http://svn.opendune.org/~glx/temp.diff
14:44:07 <TrueBrain> maybe better to make the variable signed in the definition?
14:44:18 <TrueBrain> as I assume function() returns a signed value too?
14:46:00 <glx> well function returns an uint16 but it's indeed a signed value
14:46:25 <glx> same for Unit_Unknown3146()
14:46:37 <glx> (called by function() )
14:48:06 <TrueBrain> better to make them all signed :)
14:51:08 <TrueBrain> okay, this really doesn't make sense to me ... when you walk in a structure of the enemy, some AI code is triggered
14:51:10 <TrueBrain> the rules:
14:51:17 <TrueBrain> if a unit cannot fire, ignore
14:51:20 <TrueBrain> but then:
14:51:38 <TrueBrain> if unit->actionID != GUARD && unit->actionID != AREA_GUARD: ignore
14:52:00 <TrueBrain> if unit->actionID != GUARD && unit->actionID == AREA_GUARD: GO-HUNT
14:52:13 <TrueBrain> if unit->actionID == GUARD && unit->actionID == AMBUSH: GO-HUNT
14:52:19 <TrueBrain> the last one REALLY doesn't make any sense ...
14:55:49 <TrueBrain> http://pastebin.com/1VputND4
15:05:43 <TrueBrain> translates to: if ((action == GUARD && action == AMBUSH) || action == AREA_GUARD) GO-HUNT
15:05:52 <TrueBrain> (if you look at the order of the decompiled code)
15:12:05 <glx> http://svn.opendune.org/~glx/temp.diff <-- removed function param as it's "constant"
15:12:44 <glx> and partly revert r1325
15:12:55 <TrueBrain> it was most likely a parameter, because it is an evaluation function
15:12:57 <TrueBrain> so you could replace that :)
15:13:34 <glx> (176C was script_unit, not unit)
15:14:08 <TrueBrain> so I guess it is fine to move it out
15:15:08 <glx> so keep the function parameter ?
15:15:27 <TrueBrain> no, removing it is fine
15:15:35 <TrueBrain> we most likely implement our own algorithm sooner or later
15:15:41 <glx> ok
15:15:59 <glx> btw harvester still enters in the refinery ;)
15:16:01 <TrueBrain> I understand why they had it a function :)
15:16:41 <glx> I guess 1319 was a library
15:16:50 <glx> or something similar
15:17:06 <TrueBrain> a template of theirs
15:17:25 <glx> and that explains the function param
15:17:43 <TrueBrain> I would do the same :)
15:17:48 <TrueBrain> h-functions are mostly parameters :)
15:17:57 <TrueBrain> simply because it is them you tune :)
15:18:11 <glx> yup algo is constant
15:18:27 <glx> cost calculation is variable
15:18:48 <TrueBrain> I have a hard time validating my if statement above :(
15:19:16 <glx> your translation looks right
15:19:27 <TrueBrain> yeah, but now I am testing it
15:19:32 <TrueBrain> just the game doesn;t want to work with me
15:19:34 <TrueBrain> worms :(
15:19:38 <TrueBrain> deviator
15:21:08 <TrueBrain> no, it reacts different
15:21:13 <TrueBrain> when I attack a building, those units return to base
15:21:19 <TrueBrain> where in my translation they come to hunt you down
15:21:21 <TrueBrain> (much harder btw)
15:28:23 <TrueBrain> ugh, deadlocks :(
15:28:26 <TrueBrain> THEY ARE SO ANNYOING
15:30:14 <TrueBrain> hahaha, LOL!!!
15:30:20 <TrueBrain> either I converted something wrong
15:30:24 <TrueBrain> or the game is just being silly :D
15:30:29 <TrueBrain> it searches for Unit of type 0 :D
15:30:43 <TrueBrain> instead of 0xFFFF, it does 0
15:31:28 <TrueBrain> I really doubt it wants to send a carryall to hunt down the enemy :D
15:33:29 <DorpsGek> SVN: glx (r1338) -Fix (r1324, r1325): harvesters failed to enter in refinerys. Some code cleanup.
15:35:11 <glx> now your warnings ;)
15:36:12 <DorpsGek> SVN: truebrain (r1339) -Add: C-ified Structure_HouseUnderAttack(). As ENHANCEMENT, the game is now much harder when you attack a structure of the AI. They now massively come hunt you down. Payback is a bitch
15:44:01 <TrueBrain> http://forum.opendune.org/viewtopic.php?f=9&t=129
15:44:03 <TrueBrain> :D
15:47:35 <glx> Avertissement 1 warning C4018: '>' : incompatibilité signed/unsigned d:\developpement\opendune\trunk2\src\structure.c 2027
15:47:36 <glx> if (t->overlaySpriteID < g_global->variable_39F2 - 15 || t->overlaySpriteID > g_global->variable_39F2) {
15:47:57 <TrueBrain> that is weird
15:47:59 <TrueBrain> we do that more often
15:48:30 <TrueBrain> huh, they are both signed?
15:48:32 <TrueBrain> euh, unsigned
15:48:42 <glx> xxx - 15 is signed
15:48:55 <TrueBrain> sigh
15:48:58 <TrueBrain> stupid MSVC
15:49:16 <TrueBrain> not only is that not true, it is also silly
15:49:22 <TrueBrain> either way, src/map.c, does the same
15:50:11 <TrueBrain> only the - 15 is on the left hand, and && is used instead of || :p
15:50:23 <TrueBrain> sems to me, MSVC is not really consistant
15:50:34 <glx> if (t->overlaySpriteID + 15 < g_global->variable_39F2 || t->overlaySpriteID > g_global->variable_39F2) {
15:50:37 <glx> fixed
15:51:03 <TrueBrain> can you also 'fix' the src/map.c entry?
15:51:10 <TrueBrain> moving the -16 to +16?
15:51:14 <TrueBrain> (why is it 16 there? Is that a typo?)
15:52:38 <glx> oh overlaySpriteID is uint16, t->overlaySpriteID is unsigned int : 7
15:53:11 <glx> that may explain why 1 case warns
15:53:21 <TrueBrain> btw, it is much harder to read with +15
15:53:42 <TrueBrain> if (g_global->variable_39F2 >= t->overlaySpriteID + 15 || t->overlaySpriteID > g_global->variable_39F2) {
15:53:44 <TrueBrain> maybe?
15:54:01 <TrueBrain> if (t->overlaySpriteID > g_global->variable_39F2 || g_global->variable_39F2 >= t->overlaySpriteID + 15) {
15:54:11 <TrueBrain> if (t->overlaySpriteID > g_global->variable_39F2 || g_global->variable_39F2 > t->overlaySpriteID + 16) {
15:54:37 <TrueBrain> or is it +14 then?
15:55:03 <TrueBrain> well, maybe leave the >= then, I dunno ...
15:56:27 <TrueBrain> yeah, should be +14, but that makes even less sense :p
15:59:47 <TrueBrain> seems that they don't really cared how long it was
16:00:13 <TrueBrain> <= +15, !>=+15, !>=+14
16:00:28 <TrueBrain> well, we figure it out some day :)
16:01:31 <DorpsGek> SVN: truebrain (r1340) -Fix (r1339): forgot to commit all files
16:03:16 <DorpsGek> SVN: glx (r1341) -Fix: MSVC warnings
16:07:35 <TrueBrain> euh, why > + 15?
16:07:38 <TrueBrain> isn't it >= + 15?
16:08:20 <glx> it was xxx > yyy - 15
16:08:23 <TrueBrain> a < b - 15 => b >= a + 15 ?
16:08:53 <glx> so xxx + 15 > yyy --> yyy < xxx + 15
16:09:03 <TrueBrain> you are right :)
16:09:15 <TrueBrain> for some reason I am so used to change > into <=
16:09:17 <TrueBrain> but that is !>
16:12:08 <DorpsGek> SVN: truebrain (r1342) -Fix: for consistancy, do all double-compares in the same format
16:19:49 <TrueBrain> it really was a nasty glitch, searching for unit type 0 ...
16:19:53 <TrueBrain> it happens in one other case too ...
16:20:08 <TrueBrain> there it might be intended, for pickup
16:20:14 <TrueBrain> but I guess they just copy/pasted it :D
16:53:19 <glx> oh now I can do f__0F3F_0168_0010_C9EF() and emu_Unknown_07C4_001A()
16:55:39 <TrueBrain> one of those 0F3F is GetDirection btw
16:55:49 <TrueBrain> I noticed that in the PF
16:59:18 <glx> that's probably f__0F3F_0168_0010_C9EF() ;) (the only one used in pathfinder)
17:04:46 <glx> Tile_GetDirection(from, to) ?
17:20:27 <TrueBrain> would be my best guess :)
17:27:48 <DorpsGek> SVN: glx (r1343) -Add: C-ified Tile_GetDirection()
17:30:49 <TrueBrain> k, pretty sure it is a copy/paste error, the 0 vs 0xFFFF in r1339 :)
17:30:53 <TrueBrain> (of Dune2, that is)
17:32:10 <glx> not the first one
17:38:08 <glx> now doing f__0F3F_028E_0015_1153()
17:44:41 <DorpsGek> SVN: truebrain (r1344) -Add: C-ified Structure_AI_PickNextToBuild()
17:44:44 <TrueBrain> one 1423 left ..
17:45:18 <TrueBrain> kind of big :p
17:48:14 <DorpsGek> SVN: truebrain (r1345) -Fix: remove unused emu_ functions
17:48:38 <TrueBrain> src/unknown/emu_B483.c: emu_Unknown_B483_0156 no longer used
17:48:40 <TrueBrain> src/unknown/emu_07D4.c: emu_Unknown_07D4_0000 no longer used
17:48:41 <TrueBrain> src/unknown/emu_07D4.c: emu_Unknown_07D4_159A no longer used
17:48:43 <TrueBrain> src/unknown/emu_2903.c: emu_Unknown_2903_00CA no longer used
17:48:44 <TrueBrain> but I don't know if they are valid
17:48:48 <TrueBrain> it only checks if they ar eused in decompiled/, not in src/ ;)
17:49:16 <TrueBrain> right, not valid :D
18:31:44 <glx> http://svn.opendune.org/~glx/temp.patch <-- how to name it ?
18:59:21 <Xaroth|Work> hm
18:59:28 <Xaroth|Work> no clue
21:28:49 <TrueBrain> Tile_MoveToDirection?
21:28:59 <TrueBrain> Tile_AddDirectionDistance
21:29:01 <TrueBrain> :p
21:29:46 <TrueBrain> Tile_AddDistanceInDirection
21:29:47 <TrueBrain> :D
21:29:50 <TrueBrain> planetmaker: help us out ;)
21:30:45 <TrueBrain> Tile_MoveInDirection
21:30:50 <TrueBrain> I dunno
21:30:53 <TrueBrain> something like that :p
21:32:44 <planetmaker> what does it do?
21:34:28 <TrueBrain> don't my names explain that enough? :(
21:34:34 <TrueBrain> it moves a tile in the direction you give it for a given distance
21:35:04 <planetmaker> uhm... moves a tile does not make sense for me :-)
21:35:16 <planetmaker> As tiles in dune usually are fixed from my understanding
21:35:34 <planetmaker> they are a part of a fixed map
21:36:05 <TrueBrain> but you can move around on that map
21:37:10 <planetmaker> a vehicle or other unit, yes
21:37:27 <TrueBrain> but a pointer to a tile too, not? :)
21:37:52 <planetmaker> Vehicle::MoveToTile(tile *id)
21:38:04 <TrueBrain> no no
21:38:06 <planetmaker> Vehicle::MoveDirection(direction *dir) ;-)
21:38:11 <Xaroth|Work> this is C :P
21:38:18 <TrueBrain> no need to start being silly now
21:38:23 <TrueBrain> we talk about existing code we need to name
21:38:27 <TrueBrain> no need to throw OpenTTD in there :p
21:38:57 <planetmaker> But you move a vehicle, don't you?
21:39:02 <TrueBrain> no
21:39:05 <TrueBrain> we move a tile
21:39:10 <TrueBrain> if you are on tile A1
21:39:13 <TrueBrain> then you can go to tile B2
21:39:25 <TrueBrain> look at the pathfinder in OpenTTD
21:39:30 <TrueBrain> it moves around by direction there too
21:40:08 <glx> Tile_MoveInDirection feels nice
21:40:16 <planetmaker> Tile_MoveByDirection
21:40:25 <planetmaker> Tile_MoveToTile
21:40:38 <planetmaker> or Tile_MoveRelative
21:40:42 <TrueBrain> ByDirection is better tbh
21:40:42 <planetmaker> Tile_MoveAbsolute
21:40:43 <glx> tile32 f__0F3F_028E_0015_1153(tile32 tile, int16 orientation, uint16 distance)
21:40:46 <TrueBrain> see planetmaker, not that hard ;) :D
21:41:13 <planetmaker> well, but that you deal with a pf moving around in the map searching. That was the crucial information which was needed to make sense of it
21:41:35 <glx> it's not pf related in this case ;)
21:41:37 <TrueBrain> you and your sense :D
21:41:45 <planetmaker> :-P
21:41:51 <TrueBrain> so MoveByDirection sounds best imo :)
21:43:07 <planetmaker> :-)
21:43:31 <TrueBrain> tnx planetmaker :D
21:43:41 <planetmaker> np :-)
21:46:33 <DorpsGek> SVN: glx (r1346) -Add: C-ified Tile_MoveByDirection()
22:11:18 <TrueBrain> hmm .. B483_0353 (one of the unknowns) gives a white text on the screen I guess
22:13:39 <glx> 353?
22:13:59 <TrueBrain> 363
22:14:02 <TrueBrain> can't type etc etc
22:16:29 <TrueBrain> fuck ... I thought goto 0B61 were 'returns'
22:16:31 <TrueBrain> they are not
22:16:32 <TrueBrain> fuck
22:26:44 <glx> B4B8_0000 is huge
22:31:53 <TrueBrain> Sabateur code is weird
22:31:59 <TrueBrain> before campaign 3 it has special code
22:32:07 <TrueBrain> but ... how .... ever .... don't ... understand ....
22:32:39 <TrueBrain> even ScenarioID, which is even more weird
22:38:27 <TrueBrain> it is very nice no longer needing csips everywhere :D
22:41:08 <glx> hehe
22:41:43 <TrueBrain> dune2 always will be dune2 ....
22:41:54 <TrueBrain> if (a && (b || c)) { if (b) {} else {} }
22:42:02 <TrueBrain> why not: if (a) { if (b) {} else if (c) {} }
22:42:05 <TrueBrain> *sigh*
22:42:32 <Xaroth|Work> maybe some form of wierd optimizations?
22:42:43 <TrueBrain> the latter would be
22:42:45 <TrueBrain> the first, hell no
22:42:49 <Xaroth|Work> hence, wierd :P
22:42:55 <glx> my struct_1319 struct is there only to remove csip
22:43:00 * planetmaker optimizes sleep time and wishes a good night :-)
22:43:05 <Xaroth|Work> nn pm
22:43:11 <TrueBrain> sleep well planetmaker
22:49:49 <TrueBrain> right, this function most likely has errors, but what the hell
22:51:44 <TrueBrain> hmm, now if they shot down a unit of mine, they all come to hunt me down
22:51:45 <TrueBrain> haha
22:51:54 <TrueBrain> it become a very stupid idea to scan the map :D
22:53:45 <glx> unless you fire&forget your explorator
22:54:48 <TrueBrain> ah, turns out to be a bug on my side :)
22:54:56 <TrueBrain> every unit that came in your overview became hunting :D
22:55:08 <TrueBrain> now it is what it should be
22:55:13 <TrueBrain> if you unveil an AMBUSH unit
22:55:16 <TrueBrain> it starts to HUNT
22:55:22 <TrueBrain> AMBUSH is with that what you expect
22:55:28 <TrueBrain> it keeps lowprofile, till it sees you
22:55:29 <TrueBrain> then BAM
22:55:47 <glx> like the ordos units in A1
22:55:55 <TrueBrain> exactly
22:57:55 <DorpsGek> SVN: truebrain (r1347) -Add: C-ified Unit_HouseUnitCount_Add(). Segment 1423 comes to an end. You have been good to us.
22:58:00 <TrueBrain> even slipped in a (uint8) cast
23:02:06 <DorpsGek> SVN: truebrain (r1348) -Fix: remove unused emulator functions
23:05:19 <TrueBrain> woei
23:05:21 <TrueBrain> good weekend :D
23:05:33 <glx> so a 0F3F is free to be C-ified without wrapper
23:05:39 <TrueBrain> I dunno
23:05:57 <TrueBrain> seems there is one usage
23:06:00 <TrueBrain> of 01A1
23:06:02 <TrueBrain> the other is unused
23:06:30 <glx> 01A1 is used by B4B8_0000
23:06:32 <TrueBrain> B4B8_0000 .. the very long one
23:06:44 <glx> I'm on this very long one :)
23:07:24 <glx> I hate crashing VS
23:07:32 <TrueBrain> blegh, that sounds really bad
23:07:40 <TrueBrain> one of the foremost features of a IDE
23:07:42 <TrueBrain> dont crash
23:07:53 <glx> it's intellisense
23:08:53 <glx> 0F3F_0125 is used in src only
23:08:54 <TrueBrain> not so intelli :D
23:10:38 <TrueBrain> right, off to bed for me
23:10:40 <TrueBrain> night
23:11:08 <glx> anyway b4b8_0000 will take some time
23:11:23 <glx> so feel free to touch other parts of the code :)
23:16:15 <glx> hmm I can't skip dialogs when starting a game
23:16:26 <glx> you know the mentat gui ;)