Closed mabre closed 10 years ago
@Kegny Please push your work to a branch.
There is still a some little optimations left, but it works quite fine by now, I'm leaving this open for now, so that you can report bugs
more or less minor bug: Sometimes terrain is added, not destroyed. (Might be intentional?)
(note the additional \
block.)
log:
key pressed: SPACE
CLIENT send: client228764 KEYEVENT Space
SERVER sent command to client228764/HOST: COMMAND CURRENT_FIGURE_SHOOT
CLIENT RECEIVED: COMMAND CURRENT_FIGURE_SHOOT
created projectile at 567.59408547448 193.16156208800663, v=Point2D [x = -9.702957262759965, y = -2.4192189559966795]
munition left: 36
start position: Point2D [x = 567.59408547448, y = 193.16156208800663]
normalized velocity: Point2D [x = -0.9702957262759965, y = -0.24192189559966795]
checking new position for collision: Point2D [x = 566.623789748204, y = 192.91964019240697] (1/10) Rectangle2D [minX = 566.623789748204, minY=192.91964019240697, maxX=570.623789748204, maxY=196.91964019240697, width=4.0, height=4.0]
checking new position for collision: Point2D [x = 565.6534940219279, y = 192.6777182968073] (2/10) Rectangle2D [minX = 565.6534940219279, minY=192.6777182968073, maxX=569.6534940219279, maxY=196.6777182968073, width=4.0, height=4.0]
checking new position for collision: Point2D [x = 564.6831982956519, y = 192.43579640120765] (3/10) Rectangle2D [minX = 564.6831982956519, minY=192.43579640120765, maxX=568.6831982956519, maxY=196.43579640120765, width=4.0, height=4.0]
checking new position for collision: Point2D [x = 563.7129025693758, y = 192.193874505608] (4/10) Rectangle2D [minX = 563.7129025693758, minY=192.193874505608, maxX=567.7129025693758, maxY=196.193874505608, width=4.0, height=4.0]
checking new position for collision: Point2D [x = 562.7426068430998, y = 191.95195261000833] (5/10) Rectangle2D [minX = 562.7426068430998, minY=191.95195261000833, maxX=566.7426068430998, maxY=195.95195261000833, width=4.0, height=4.0]
checking new position for collision: Point2D [x = 561.7723111168237, y = 191.71003071440867] (6/10) Rectangle2D [minX = 561.7723111168237, minY=191.71003071440867, maxX=565.7723111168237, maxY=195.71003071440867, width=4.0, height=4.0]
checking new position for collision: Point2D [x = 560.8020153905477, y = 191.46810881880901] (7/10) Rectangle2D [minX = 560.8020153905477, minY=191.46810881880901, maxX=564.8020153905477, maxY=195.46810881880901, width=4.0, height=4.0]
checking new position for collision: Point2D [x = 559.8317196642716, y = 191.22618692320935] (8/10) Rectangle2D [minX = 559.8317196642716, minY=191.22618692320935, maxX=563.8317196642716, maxY=195.22618692320935, width=4.0, height=4.0]
checking new position for collision: Point2D [x = 558.8614239379956, y = 190.9842650276097] (9/10) Rectangle2D [minX = 558.8614239379956, minY=190.9842650276097, maxX=562.8614239379956, maxY=194.9842650276097, width=4.0, height=4.0]
checking new position for collision: Point2D [x = 557.8911282117195, y = 190.74234313201003] (10/10) Rectangle2D [minX = 557.8911282117195, minY=190.74234313201003, maxX=561.8911282117195, maxY=194.74234313201003, width=4.0, height=4.0]
SERVER sent command to client228764/HOST: COMMAND PROJECTILE_SET_POSITION 557.8911282117195 190.74234313201003
CLIENT RECEIVED: COMMAND PROJECTILE_SET_POSITION 557.8911282117195 190.74234313201003
start position: Point2D [x = 557.8911282117195, y = 190.74234313201003]
normalized velocity: Point2D [x = -0.9702957262759965, y = -0.24192189559966795]
checking new position for collision: Point2D [x = 556.9208324854435, y = 190.50042123641038] (1/10) Rectangle2D [minX = 556.9208324854435, minY=190.50042123641038, maxX=560.9208324854435, maxY=194.50042123641038, width=4.0, height=4.0]
checking new position for collision: Point2D [x = 555.9505367591674, y = 190.25849934081072] (2/10) Rectangle2D [minX = 555.9505367591674, minY=190.25849934081072, maxX=559.9505367591674, maxY=194.25849934081072, width=4.0, height=4.0]
checking new position for collision: Point2D [x = 554.9802410328914, y = 190.01657744521106] (3/10) Rectangle2D [minX = 554.9802410328914, minY=190.01657744521106, maxX=558.9802410328914, maxY=194.01657744521106, width=4.0, height=4.0]
checking new position for collision: Point2D [x = 554.0099453066154, y = 189.7746555496114] (4/10) Rectangle2D [minX = 554.0099453066154, minY=189.7746555496114, maxX=558.0099453066154, maxY=193.7746555496114, width=4.0, height=4.0]
checking new position for collision: Point2D [x = 553.0396495803393, y = 189.53273365401174] (5/10) Rectangle2D [minX = 553.0396495803393, minY=189.53273365401174, maxX=557.0396495803393, maxY=193.53273365401174, width=4.0, height=4.0]
checking new position for collision: Point2D [x = 552.0693538540633, y = 189.29081175841208] (6/10) Rectangle2D [minX = 552.0693538540633, minY=189.29081175841208, maxX=556.0693538540633, maxY=193.29081175841208, width=4.0, height=4.0]
checking new position for collision: Point2D [x = 551.0990581277872, y = 189.04888986281242] (7/10) Rectangle2D [minX = 551.0990581277872, minY=189.04888986281242, maxX=555.0990581277872, maxY=193.04888986281242, width=4.0, height=4.0]
checking new position for collision: Point2D [x = 550.1287624015112, y = 188.80696796721276] (8/10) Rectangle2D [minX = 550.1287624015112, minY=188.80696796721276, maxX=554.1287624015112, maxY=192.80696796721276, width=4.0, height=4.0]
checking new position for collision: Point2D [x = 549.1584666752351, y = 188.5650460716131] (9/10) Rectangle2D [minX = 549.1584666752351, minY=188.5650460716131, maxX=553.1584666752351, maxY=192.5650460716131, width=4.0, height=4.0]
checking new position for collision: Point2D [x = 548.188170948959, y = 188.32312417601344] (10/10) Rectangle2D [minX = 548.188170948959, minY=188.32312417601344, maxX=552.188170948959, maxY=192.32312417601344, width=4.0, height=4.0]
SERVER sent command to client228764/HOST: COMMAND PROJECTILE_SET_POSITION 548.188170948959 188.32312417601344
CLIENT RECEIVED: COMMAND PROJECTILE_SET_POSITION 548.188170948959 188.32312417601344
start position: Point2D [x = 548.188170948959, y = 188.32312417601344]
normalized velocity: Point2D [x = -0.9702957262759965, y = -0.24192189559966795]
checking new position for collision: Point2D [x = 547.217875222683, y = 188.08120228041378] (1/10) Rectangle2D [minX = 547.217875222683, minY=188.08120228041378, maxX=551.217875222683, maxY=192.08120228041378, width=4.0, height=4.0]
checking new position for collision: Point2D [x = 546.247579496407, y = 187.83928038481412] (2/10) Rectangle2D [minX = 546.247579496407, minY=187.83928038481412, maxX=550.247579496407, maxY=191.83928038481412, width=4.0, height=4.0]
checking new position for collision: Point2D [x = 545.2772837701309, y = 187.59735848921446] (3/10) Rectangle2D [minX = 545.2772837701309, minY=187.59735848921446, maxX=549.2772837701309, maxY=191.59735848921446, width=4.0, height=4.0]
checking new position for collision: Point2D [x = 544.3069880438549, y = 187.3554365936148] (4/10) Rectangle2D [minX = 544.3069880438549, minY=187.3554365936148, maxX=548.3069880438549, maxY=191.3554365936148, width=4.0, height=4.0]
checking new position for collision: Point2D [x = 543.3366923175788, y = 187.11351469801514] (5/10) Rectangle2D [minX = 543.3366923175788, minY=187.11351469801514, maxX=547.3366923175788, maxY=191.11351469801514, width=4.0, height=4.0]
checking new position for collision: Point2D [x = 542.3663965913028, y = 186.87159280241548] (6/10) Rectangle2D [minX = 542.3663965913028, minY=186.87159280241548, maxX=546.3663965913028, maxY=190.87159280241548, width=4.0, height=4.0]
checking new position for collision: Point2D [x = 541.3961008650267, y = 186.62967090681582] (7/10) Rectangle2D [minX = 541.3961008650267, minY=186.62967090681582, maxX=545.3961008650267, maxY=190.62967090681582, width=4.0, height=4.0]
diagonal / intersection at 542x190px
intersection at 67 23 with \
CollisionException, let's do this!
Explosion of: "\" (67 23)Resistance: 4.5; Explosionpower: 100
Explosion of: " " (67 24)Resistance: 15.0; Explosionpower: 95
Explosion of: " " (67 25)Resistance: 15.0; Explosionpower: 80
Explosion of: "W" (67 26)Resistance: 9.9999999E7; Explosionpower: 65
Explosion of: " " (66 25)Resistance: 15.0; Explosionpower: 65
Explosion of: "W" (66 26)Resistance: 9.9999999E7; Explosionpower: 50
Explosion of: " " (65 25)Resistance: 15.0; Explosionpower: 50
Explosion of: "W" (65 26)Resistance: 9.9999999E7; Explosionpower: 35
Explosion of: " " (64 25)Resistance: 15.0; Explosionpower: 35
Explosion of: "W" (64 26)Resistance: 9.9999999E7; Explosionpower: 20
Explosion of: " " (63 25)Resistance: 15.0; Explosionpower: 20
Explosion of: "W" (63 26)Resistance: 9.9999999E7; Explosionpower: 5
Explosion of: " " (62 25)Resistance: 15.0; Explosionpower: 5
Explosion of: " " (63 24)Resistance: 15.0; Explosionpower: 5
Explosion of: " " (64 24)Resistance: 15.0; Explosionpower: 20
Explosion of: " " (63 24)Resistance: 15.0; Explosionpower: 5
Explosion of: " " (65 24)Resistance: 15.0; Explosionpower: 5
Explosion of: "I" (64 23)Resistance: 30.0; Explosionpower: 5
Explosion of: " " (65 24)Resistance: 15.0; Explosionpower: 35
Explosion of: " " (66 24)Resistance: 15.0; Explosionpower: 20
Explosion of: "I" (66 23)Resistance: 30.0; Explosionpower: 5
Explosion of: "I" (65 23)Resistance: 30.0; Explosionpower: 20
Explosion of: " " (68 25)Resistance: 15.0; Explosionpower: 65
Explosion of: "W" (68 26)Resistance: 9.9999999E7; Explosionpower: 50
Explosion of: " " (69 25)Resistance: 15.0; Explosionpower: 50
Explosion of: "W" (69 26)Resistance: 9.9999999E7; Explosionpower: 35
Explosion of: " " (70 25)Resistance: 15.0; Explosionpower: 35
Explosion of: "W" (70 26)Resistance: 9.9999999E7; Explosionpower: 20
Explosion of: " " (71 25)Resistance: 15.0; Explosionpower: 20
Explosion of: "W" (71 26)Resistance: 9.9999999E7; Explosionpower: 5
Explosion of: " " (72 25)Resistance: 15.0; Explosionpower: 5
Explosion of: " " (71 24)Resistance: 15.0; Explosionpower: 5
Explosion of: " " (70 24)Resistance: 15.0; Explosionpower: 20
Explosion of: " " (69 24)Resistance: 15.0; Explosionpower: 5
Explosion of: " " (71 24)Resistance: 15.0; Explosionpower: 5
Explosion of: " " (70 23)Resistance: 15.0; Explosionpower: 5
Explosion of: " " (69 24)Resistance: 15.0; Explosionpower: 35
Explosion of: " " (68 24)Resistance: 15.0; Explosionpower: 20
Explosion of: " " (68 23)Resistance: 15.0; Explosionpower: 5
Explosion of: " " (69 23)Resistance: 15.0; Explosionpower: 20
Explosion of: " " (68 23)Resistance: 15.0; Explosionpower: 5
Explosion of: " " (70 23)Resistance: 15.0; Explosionpower: 5
Explosion of: " " (69 22)Resistance: 15.0; Explosionpower: 5
Explosion of: "I" (66 23)Resistance: 30.0; Explosionpower: 95
Explosion of: "I" (65 23)Resistance: 30.0; Explosionpower: 65
Explosion of: "I" (64 23)Resistance: 30.0; Explosionpower: 35
Explosion of: "I" (63 23)Resistance: 30.0; Explosionpower: 5
Explosion of: "I" (64 22)Resistance: 30.0; Explosionpower: 5
Explosion of: "I" (65 22)Resistance: 30.0; Explosionpower: 35
Explosion of: "I" (64 22)Resistance: 30.0; Explosionpower: 5
Explosion of: "I" (66 22)Resistance: 30.0; Explosionpower: 5
Explosion of: "I" (65 21)Resistance: 30.0; Explosionpower: 5
Explosion of: "I" (66 22)Resistance: 30.0; Explosionpower: 65
Explosion of: "I" (67 22)Resistance: 30.0; Explosionpower: 35
Explosion of: "\" (68 22)Resistance: 4.5; Explosionpower: 5
Explosion of: "I" (67 21)Resistance: 30.0; Explosionpower: 5
Explosion of: "I" (66 21)Resistance: 30.0; Explosionpower: 35
Explosion of: "I" (65 21)Resistance: 30.0; Explosionpower: 5
Explosion of: "I" (67 21)Resistance: 30.0; Explosionpower: 5
Explosion of: "I" (66 20)Resistance: 30.0; Explosionpower: 5
Explosion of: " " (68 23)Resistance: 15.0; Explosionpower: 95
SERVER sent command to client228764/HOST: COMMAND REMOVE_FLYING_PROJECTILE
SERVER sent command to client228764/HOST: COMMAND REPLACE_BLOCK 63 25 #
CLIENT RECEIVED: COMMAND REMOVE_FLYING_PROJECTILE
SERVER sent command to client228764/HOST: COMMAND REPLACE_BLOCK 64 24 #
CLIENT RECEIVED: COMMAND REPLACE_BLOCK 63 25 #
SERVER sent command to client228764/HOST: COMMAND REPLACE_BLOCK 64 25 #
CLIENT RECEIVED: COMMAND REPLACE_BLOCK 64 24 #
CLIENT RECEIVED: COMMAND REPLACE_BLOCK 64 25 #
SERVER sent command to client228764/HOST: COMMAND REPLACE_BLOCK 66 24 #
CLIENT RECEIVED: COMMAND REPLACE_BLOCK 66 24 #
SERVER sent command to client228764/HOST: COMMAND REPLACE_BLOCK 65 23 \
CLIENT RECEIVED: COMMAND REPLACE_BLOCK 65 23 \
SERVER sent command to client228764/HOST: COMMAND REPLACE_BLOCK 65 24 #
CLIENT RECEIVED: COMMAND REPLACE_BLOCK 65 24 #
SERVER sent command to client228764/HOST: COMMAND REPLACE_BLOCK 65 25 #
CLIENT RECEIVED: COMMAND REPLACE_BLOCK 65 25 #
SERVER sent command to client228764/HOST: COMMAND REPLACE_BLOCK 66 25 #
CLIENT RECEIVED: COMMAND REPLACE_BLOCK 66 25 #
SERVER sent command to client228764/HOST: COMMAND REPLACE_BLOCK 71 25 #
CLIENT RECEIVED: COMMAND REPLACE_BLOCK 71 25 #
SERVER sent command to client228764/HOST: COMMAND REPLACE_BLOCK 70 24 #
CLIENT RECEIVED: COMMAND REPLACE_BLOCK 70 24 #
SERVER sent command to client228764/HOST: COMMAND REPLACE_BLOCK 70 25 #
CLIENT RECEIVED: COMMAND REPLACE_BLOCK 70 25 #
SERVER sent command to client228764/HOST: COMMAND REPLACE_BLOCK 68 24 #
CLIENT RECEIVED: COMMAND REPLACE_BLOCK 68 24 #
SERVER sent command to client228764/HOST: COMMAND REPLACE_BLOCK 69 22 \
CLIENT RECEIVED: COMMAND REPLACE_BLOCK 69 22 \
SERVER sent command to client228764/HOST: COMMAND REPLACE_BLOCK 69 23 #
SERVER sent command to client228764/HOST: COMMAND REPLACE_BLOCK 69 24 #
SERVER sent command to client228764/HOST: COMMAND REPLACE_BLOCK 69 25 #
SERVER sent command to client228764/HOST: COMMAND REPLACE_BLOCK 68 25 #
SERVER sent command to client228764/HOST: COMMAND REPLACE_BLOCK 67 25 #
SERVER sent command to client228764/HOST: COMMAND REPLACE_BLOCK 67 24 #
SERVER sent command to client228764/HOST: COMMAND REPLACE_BLOCK 64 23 #
SERVER sent command to client228764/HOST: COMMAND REPLACE_BLOCK 65 22 #
SERVER sent command to client228764/HOST: COMMAND REPLACE_BLOCK 65 23 #
SERVER sent command to client228764/HOST: COMMAND REPLACE_BLOCK 68 22 #
SERVER sent command to client228764/HOST: COMMAND REPLACE_BLOCK 67 22 #
SERVER sent command to client228764/HOST: COMMAND REPLACE_BLOCK 66 21 #
SERVER sent command to client228764/HOST: COMMAND REPLACE_BLOCK 66 22 #
SERVER sent command to client228764/HOST: COMMAND REPLACE_BLOCK 66 23 #
SERVER sent command to client228764/HOST: COMMAND REPLACE_BLOCK 68 23 #
SERVER sent command to client228764/HOST: COMMAND REPLACE_BLOCK 67 23 #
SERVER sent command to client228764/HOST: COMMAND RELOAD_TERRAIN
SERVER sent command to client228764/HOST: COMMAND SET_TURN_COUNT 27
SERVER sent command to client228764/HOST: COMMAND DEACTIVATE_FIGURE 0
SERVER sent command to client228764/HOST: COMMAND SET_CURRENT_TEAM 1
SERVER sent command to client228764/HOST: COMMAND CURRENT_TEAM_END_ROUND 1
SERVER sent command to client228764/HOST: COMMAND ACTIVATE_FIGURE 1
SERVER sent command to client228764/HOST: COMMAND TEAM_LABEL_SET_TEXT Turn: 27 It’s Team 2’s turn! What will Max86 do?
Turn: 27 It’s Team 2’s turn! What will Max86 do?
CLIENT RECEIVED: COMMAND REPLACE_BLOCK 69 23 #
CLIENT RECEIVED: COMMAND REPLACE_BLOCK 69 24 #
CLIENT RECEIVED: COMMAND REPLACE_BLOCK 69 25 #
CLIENT RECEIVED: COMMAND REPLACE_BLOCK 68 25 #
CLIENT RECEIVED: COMMAND REPLACE_BLOCK 67 25 #
CLIENT RECEIVED: COMMAND REPLACE_BLOCK 67 24 #
CLIENT RECEIVED: COMMAND REPLACE_BLOCK 64 23 #
CLIENT RECEIVED: COMMAND REPLACE_BLOCK 65 22 #
CLIENT RECEIVED: COMMAND REPLACE_BLOCK 65 23 #
CLIENT RECEIVED: COMMAND REPLACE_BLOCK 68 22 #
CLIENT RECEIVED: COMMAND REPLACE_BLOCK 67 22 #
CLIENT RECEIVED: COMMAND REPLACE_BLOCK 66 21 #
CLIENT RECEIVED: COMMAND REPLACE_BLOCK 66 22 #
CLIENT RECEIVED: COMMAND REPLACE_BLOCK 66 23 #
CLIENT RECEIVED: COMMAND REPLACE_BLOCK 68 23 #
CLIENT RECEIVED: COMMAND REPLACE_BLOCK 67 23 #
CLIENT RECEIVED: COMMAND RELOAD_TERRAIN
CLIENT RECEIVED: COMMAND SET_TURN_COUNT 27
CLIENT RECEIVED: COMMAND DEACTIVATE_FIGURE 0
CLIENT RECEIVED: COMMAND SET_CURRENT_TEAM 1
CLIENT RECEIVED: COMMAND CURRENT_TEAM_END_ROUND 1
CLIENT RECEIVED: COMMAND ACTIVATE_FIGURE 1
CLIENT RECEIVED: COMMAND TEAM_LABEL_SET_TEXT Turn: 27 It’s Team 2’s turn! What will Max86 do?
I merged master
and weaponsFF
into a new branch destroy
(quite complicated merge). Local game seems to work, network game has some problems:
This time you didn't do to well on the merge. You readded a few Bugs, which had been already fixed, reintroduced variables I kicked and readded them into the contructors and I believe the first thing was caused by you, when on Figure-deactivation you forgot to reallow shooting?
As for the Problems: Any weapon was VISIBLE to the client: Due to missing and them not causing any damage to terrain you might not have noticed? Anyway I should have fixed that already.
And what is up with this DeathException? Where does it come from and why is it suddenly important? It worked before, didn't it?
And while I'm at asking why are we checking if the weapons-ArrayList is long enough? Shouldn't be every weapon in the game be contained in it anyway?
And your runlater attempt at the labels doesn't work
Ok, I think the automatic part of the merge process and me not understanding all changes atm introduced some problems.
And what is up with this DeathException? Where does it come from and why is it suddenly important? It worked before, didn't it?
The exception has been introduced in dbe588c354808ee32332a4355b9d963c9626e915, it’s important when the current figure dies by fall damage. I think the part where I wrote “ somewhat important” isn’t really important, though.
And while I'm at asking why are we checking if the weapons-ArrayList is long enough? Shouldn't be every weapon in the game be contained in it anyway?
I think the original intention was that one might want to play with one weapon only, which is then mapped to 1. But we probably want to have a strict weapon (type) ↔ key association, so the check is really unnecessary. (And we should check shootingIsAllowed
on the server side.)
Ah ok, now I begin to understand. And when does this falling begin? Is it like in reality allways or technically somewhat later? Because it still seems a bit odd to me that we are throwing an exception for this within the damagepart of a weapon when in figuresclass there already is an if-clause "catching" that. Or am I still misunderstanding?
Ok, we'll discuss this anyway when we discuss the weaponselectionthing next teammeeting, so I'll leave that in the code for now.
Did I again put this check onto clientside? I always confuse those :/
Oh and as of the labelproblem: tobi gave me last Tuesday the hint/solution idea that we'd might have to define the size/font/etc. of the text beforehand. Haven't gotten to test this yet