Former Site Admin
Posts: 3814
Joined: 08 Jan 2009, 23:00
Location: California - Pacific Time (UTC -8/-7 Summer Time)
Former Site Admin
Posts: 3814
Joined: 08 Jan 2009, 23:00
Location: California - Pacific Time (UTC -8/-7 Summer Time)
Posts: 3822
Joined: 16 Sep 2007, 22:00
KaM Skill Level: Skilled
ICQ: 269127056
Website: http://lewin.hodgman.id.au
Yahoo Messenger: lewinlewinhodgman
Location: Australia
Posts: 3822
Joined: 16 Sep 2007, 22:00
KaM Skill Level: Skilled
ICQ: 269127056
Website: http://lewin.hodgman.id.au
Yahoo Messenger: lewinlewinhodgman
Location: Australia
Former Site Admin
Posts: 3814
Joined: 08 Jan 2009, 23:00
Location: California - Pacific Time (UTC -8/-7 Summer Time)
Posts: 3822
Joined: 16 Sep 2007, 22:00
KaM Skill Level: Skilled
ICQ: 269127056
Website: http://lewin.hodgman.id.au
Yahoo Messenger: lewinlewinhodgman
Location: Australia
Everyone is compiling from source now I see? That's the good thing about open source projects. Just be careful because it might sometimes be unstable and we tend to leave debugging/cheats enabled between releases. Also we don't regularly update the version number so it's easy to have two people with different versions which can cause crashes in multiplayer..
The pseudo code sado pasted here could possibly cause the game to lag. If you paste the actual code I can help you optimise it, you can spread the load between ticks so only 1 player gets updated every tick (I guess you're updating all players every 10 ticks?) That should make it more efficient.
procedure RevealFog(Units: array of Integer; P: Integer);
var I, X, Y: Integer;
begin
for I := 0 to (Length(Units)-1) do
begin
X := States.UnitPositionX(Units[I]);
Y := States.UnitPositionY(Units[I]);
Actions.FogRevealCircle(P, X, Y, 9);
end;
end;
procedure OnMissionStart;
var P: Integer;
begin
for P := 0 to 5 do
Actions.FogCoverAll(P);
end;
procedure OnTick;
var P, R: Integer;
var Units, Units2: array of Integer;
begin
if (States.GameTime mod 10 = 0) then
for P := 0 to 5 do
begin
Actions.FogCoverAll(P);
Units := States.PlayerGetAllUnits(P);
RevealFog(Units, P);
for R := 0 to 5 do
begin
if States.PlayerAllianceCheck(P,R) then
Units2 := States.PlayerGetAllUnits(R);
RevealFog(Units2, P);
end;
end;
end;
procedure OnPlayerDefeated(P: Integer);
var I: Integer;
begin
Actions.FogRevealAll(P);
end;
Posts: 3822
Joined: 16 Sep 2007, 22:00
KaM Skill Level: Skilled
ICQ: 269127056
Website: http://lewin.hodgman.id.au
Yahoo Messenger: lewinlewinhodgman
Location: Australia
King Karolus Servant
Posts: 2154
Joined: 29 Aug 2007, 22:00
KaM Skill Level: Veteran
Location: In his dark thunderstormy castle
Posts: 3822
Joined: 16 Sep 2007, 22:00
KaM Skill Level: Skilled
ICQ: 269127056
Website: http://lewin.hodgman.id.au
Yahoo Messenger: lewinlewinhodgman
Location: Australia
I think I've asked this before but the answer was negative back then: is it yet possible to have two allies not share their vision?
King Karolus Servant
Posts: 2154
Joined: 29 Aug 2007, 22:00
KaM Skill Level: Veteran
Location: In his dark thunderstormy castle
Return to “Ideas / Suggestions”
Users browsing this forum: No registered users and 1 guest
Powered by phpBB® Forum Software © phpBB Group Designed by ST Software |