Map Database  •  FAQ  •  RSS  •  Login

FUN WITH FLAGS - game mode - description

<<

Lewin

User avatar

KaM Remake Developer

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

Post 11 Jun 2013, 16:48

Re: FUN WITH FLAGS - game mode - description

Btw: I wanted to set up a match with a second computer of mine. I took RC3 and copied the latest exe in there. Then I started and wanted to set up a local server so I can test. But after clicking the start button in the lobby the server stops with error message 'EPSException: Could not call proc'. Is it a problem with the KaM_Reamke_Server_win32.exe that is still the old version?
KaM_Remake_Server_win32.exe will only be used if you ran it directly. The server code is also compiled into the main Remake executable and if you click Create Server from within the game it will run it from within the Remake.

EPSException is a PascalScript error. But ideally we shouldn't get errors like that occurring at runtime. "Could not call proc" seems to mean it failed to call a procedure for some reason. My guess is there's some error with OnMissionStart, or some other event that occurred during loading. If you send me the map/script files I can debug it. Does it work with just 1 computer? Maybe it's something specific about the team setup you used?

I could send you an EXE which doesn't block running the game in multiplayer twice. Nobody else has your versions, so it's not like you could use it to cheat :P
<<

Shadaoe

Knight

Posts: 584

Joined: 28 Jul 2011, 22:00

Website: https://www.youtube.com/user/KaMRemake

Post 11 Jun 2013, 16:54

Re: FLORESCENCE - economy game mode - description

The stones are very neat, you can't overlook them. Nevertheless they don't change the entrance. I wonder what happens if you build a road on top of it.

Judging from the screenshot: maybe it is a good idea to extend the death zone one more tile (x=87 & 121). Because there is an angle in the mountain texture. What do you think, would it look better then? Extending the death zone is no problem inside the code, we can depend on the aesthetics of the map here.
With a road on top of it, the stone is still here ;)
Yeah that might be better looking with one tile more ! Good idea.
Oh, sorry. I didn't know you wanted to enter the competiton with your own work. You're not on the list yet ;)

Then it's settled. We don't team up. It would be counterproductive if my work prohibited your work. That's not how it's meant. Not from my side, nor from the competition's side.

Well, I can live with being penalized. I broke many of the competition's instructions, so I actually deserve that ;)
You don't deserve that ;) anyway it's your call so I'll respect it.
But it would be a shame if you don't get to enter your own script too, since you seem to have a fairly good understanding of scripting. Maybe you can come to some arrangement with Ben?
Thanks, but I don't think that it'd be nice for other people if we had an arrangement :/
<<

Siegfried

User avatar

Knight

Posts: 494

Joined: 24 Jul 2009, 22:00

Post 11 Jun 2013, 17:13

Re: FLORESCENCE - economy game mode - description

Does it work with just 1 computer? Maybe it's something specific about the team setup you used?
Oh wait, you're right. It does not run in single player either. That's strange, because with RC3 it runs, with r5407 it does not. I sent you a pm.
You don't deserve that ;) anyway it's your call so I'll respect it.
No, we don't team up then. From now on consider yourself as my arch-enemy. I will not spare you and your script :P
Thanks, but I don't think that it'd be nice for other people if we had an arrangement :/
I agree. There should not be any special rule for us.
<<

Shadaoe

Knight

Posts: 584

Joined: 28 Jul 2011, 22:00

Website: https://www.youtube.com/user/KaMRemake

Post 11 Jun 2013, 17:15

Re: FUN WITH FLAGS - game mode - description

Aha :p I'm pretty sure I won't end up with a script as long/good/well-commented/reusable as yours
<<

Siegfried

User avatar

Knight

Posts: 494

Joined: 24 Jul 2009, 22:00

Post 11 Jun 2013, 17:41

Re: FUN WITH FLAGS - game mode - description

@Lewin:
i found out what is causing the trouble ... it the Include-function on line 368. That's the function that you added, right?

I comment that out, it works. I leave it in, the EPSrange error occurs.

Does this need a special namespace or something? Like Set.Include()?
Aha :p I'm pretty sure I won't end up with a script as long/good/well-commented/reusable as yours
My aim is to set the bar high. I trust you to still jump over it :)
<<

Lewin

User avatar

KaM Remake Developer

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

Post 11 Jun 2013, 18:35

Re: FUN WITH FLAGS - game mode - description

You're trying to include i (an integer) into the set of loc_type. That's wrong for many reasons, an integer is a different data type, and also it has more than 256 combinations so it can't be in a set. Unfortunately PascalScript doesn't report that error nicely during compilation like it should... :(

Change it to "for L := p1 to p8 do" and it will work. At least I assume that's what you intended...? Actually you're using i to index the array, so you'll need a lookup table of sorts to convert the integer i into a loc_type. In normal Pascal you could use a const array to do that:
const LOOKUP: array[0..8] of loc_type = (undef, p1, p2, p3, p4, p5, p6, p7, p8);
But I think PascalScript might handle constants differently and not allow that. You could use a function for the conversion with a case statement, that thing only runs at the start so it doesn't matter if it's not blindingly fast.

EDIT: A hint: Using a string parameter in LocToIndex is kind of slow considering what you're using it for. An enumeration ("type TAxis = (axX, axY);") or just a char would be more suitable.
<<

Siegfried

User avatar

Knight

Posts: 494

Joined: 24 Jul 2009, 22:00

Post 11 Jun 2013, 19:13

Re: FUN WITH FLAGS - game mode - description

That LoctypeToInt does the trick, thank you for that. I must confess, I do miss the C-languages. Type casting is so uncomplicated there ... Also I see now that the underscores in the types were a bad choice of a convention. I consider changing them to your Ttype style before releasing the script.

Now it looks like this:
  Code:
Include(TEAM_MEMBERS[TEAM_OF_PLAYER[LoctypeToInt(lt)]], lt);
That's correct, but it's the opposite of beautiful. I tried to keep everything simple so others can use the code, but now this is hell to debug. I suck at programming.

Concerning the LocToIndex - I switched it to char now. Does the performance further increase with a type? For performance I will do everything, even adding another type to the already long list of definitions there ;)
<<

Lewin

User avatar

KaM Remake Developer

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

Post 11 Jun 2013, 20:05

Re: FUN WITH FLAGS - game mode - description

That is a bit hard to read... You could use an intermediate local variable ("PlayerTeam := TEAM_OF_PLAYER[LoctypeToInt(lt)]", "Include(TEAM_MEMBERS[PlayerTeam], lt)") if you're worried about it, but I think it's ok. In normal Pascal (Lazarus/Delphi) the typecasting is very powerful, you could solve that problem with typecasts and avoid the conversion function. Unfortunately PascalScript is a bit limited (in order to make the compiler/runtime small and efficient I guess) and not every feature is available.

Some hints for making your code more readable:
- Types should all start with T, and be written in CamelCase after that
- Enumeration elements should have 2 or 3 lowercase letter in from of them which is an abbreviation of their enumeration, followed by the name for that enumeration. Example: type TPlayerNumber = (pn1, pn2, pn3, pn4, pn5, pn6, pn7, pn8);
- You might find it easier if you start all global variables with a "g" in front (that's not a widely used style as far as I know, but it could help in long scripts like yours).
- Constants are in upper case, nothing else is

I don't think there will be any performance difference between a type and a char. Using a type is the "more correct" solution though, and could potentially be more efficient depending on how the compiler handles char.

You don't suck at programming, your code is very well written and works well, but mastering a new language takes a bit of time. This is also an unusual kind of environment, (scripting for a game) where you can't have multiple files, everything is procedural oriented and you interface with the game through a very restricted (and at the moment constantly changing) API. I haven't written anything long and complicated in dynamic scripts yet so I don't really know what it's like.
<<

Siegfried

User avatar

Knight

Posts: 494

Joined: 24 Jul 2009, 22:00

Post 11 Jun 2013, 20:30

Re: FUN WITH FLAGS - game mode - description

That is a bit hard to read... You could use an intermediate local variable ("PlayerTeam := TEAM_OF_PLAYER[LoctypeToInt(lt)]", "Include(TEAM_MEMBERS[PlayerTeam], lt)") if you're worried about it, but I think it's ok.
Ha, it's nice that you posted in the same second that I posted in another thread click. At least for sets this does not always work. Maybe I am already too tired, but I don't think I have done a simple error there, the validation does not give an error. Let's talk about that in the other thread.
- Types should all start with T, and be written in CamelCase after that (...)
I like the hungarian notation - as long as you only need one character like the T. If you need more (like in your enums) I will pass :)
I will go along with that from now on.
- Constants are in upper case, nothing else is
That is a sensitive point. Most people work with languages that use brackets. So they are used to know that every word does change the state of the program. But in Pascal delimiters are words, too. And they happen to occur very often which makes the code confusing. The many words make it easy to miss an important one. That's why I think that IN AND EXIT and RESULT are better written in uppercase so you don't miss them, because they always stand in the middle of a sentence, never alone. It's meant for us Pascal-newbies.
mastering a new language takes a bit of time.
It's interesting how I always underestimate this. You're of course right.

And once more: thanks for all the debugging support that you provide! I appreciate it.
<<

Krom

User avatar

Knights Province Developer

Posts: 3280

Joined: 09 May 2006, 22:00

KaM Skill Level: Fair

Location: Russia

Post 12 Jun 2013, 05:35

Re: FUN WITH FLAGS - game mode - description

- Constants are in upper case, nothing else is
That is a sensitive point. Most people work with languages that use brackets. So they are used to know that every word does change the state of the program. But in Pascal delimiters are words, too. And they happen to occur very often which makes the code confusing. The many words make it easy to miss an important one. That's why I think that IN AND EXIT and RESULT are better written in uppercase so you don't miss them, because they always stand in the middle of a sentence, never alone. It's meant for us Pascal-newbies.
That is just a matter of getting used to. Each language is different not only by it's set of possibilities and use, but also by its mindset. Pascal is more of a textual language, C is a more symbolic.

If you get to write Pascal with a Pascal syntax highlighter you will see all language structs are bold and all the programmers logic is in normal: http://www.liacs.nl/~svdmaar/hci/codeeditor.JPG. This helps a lot )
Knights Province at: http://www.knightsprovince.com
KaM Remake at: http://www.kamremake.com
Original MBWR/WR2/AFC/FVR tools at: http://krom.reveur.de
<<

Siegfried

User avatar

Knight

Posts: 494

Joined: 24 Jul 2009, 22:00

Post 12 Jun 2013, 10:54

Re: FUN WITH FLAGS - game mode - description

Current state on 1024x768 screen:
Image
Teaming and mixinig teams/unteamed players is possible now.

Known Bugs:
- the team members are incorrect on countdown
- final flags are counted for each team member instead of team (so a team of 4 members could get 4 flags just with 'population')

There won't be a public beta available, because to test this you need to have a version later than RC3. Especially in times where a tournament is running I don't want to go any risk there. But there will be a test with some persons who I know and of whom I am sure they won't abuse it.
<<

Shadaoe

Knight

Posts: 584

Joined: 28 Jul 2011, 22:00

Website: https://www.youtube.com/user/KaMRemake

Post 12 Jun 2013, 12:58

Re: FUN WITH FLAGS - game mode - description

Wonderful, being able to mix both teams and unteamed players is great !
That's going to be even funnier with these features and the text overlay is fitting nicely on the lowest resolution.
<<

dicsoupcan

Moorbach's Guard

Posts: 1314

Joined: 12 Feb 2012, 21:36

KaM Skill Level: Fair

Post 12 Jun 2013, 13:41

Re: FUN WITH FLAGS - game mode - description

It looks very nice indeed, did the other player took and roy as a joke or is he someone you know? :D
You have enemies? Good. That means you've stood up for something, sometime in your life. ~ Winston Churchill
<<

Siegfried

User avatar

Knight

Posts: 494

Joined: 24 Jul 2009, 22:00

Post 12 Jun 2013, 20:06

Re: FUN WITH FLAGS - game mode - description

It looks very nice indeed, did the other player took and roy as a joke or is he someone you know? :D
:lol:
No, that was me again on a second computer next to the first one. Apart from the test with Krom, Lewin and Shadaoe there has not been any public match in this mode - apart maybe from some people that got their hands on the map. I guess you know who I mean ;)

The modus is now feature-complete. It remains the testing for bugs and little polishing.

The new team mode makes the GUI a bit more complicated as you can see:
Image
I had to strip the player names from the final flags, otherwise they're spanning all over the screen. So it's only the color code left. You have to compare the color to the name on the top left to see who's score that number is.

If you find any spelling errors, please let me know. Ohterwise the GUI will go final.

Also, there have been two more changes:

1. the population flag now takes starved units into account. If any civilian starved, it will give you a permanent malus on the number. You should take care of your folk!

2. the forechecking flag now gives you a penalty of -2 for each demolished building that is located inside the valley. That means, if you build a coal mine there and it's empty, you will also be penalized on demolition of that mine. Lewin, if that would have been already there - would you still demolish your coal mines to deny me a flag? Comments on this systems are appreciated, it's not yet too late to change this back.
<<

Lewin

User avatar

KaM Remake Developer

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

Post 13 Jun 2013, 04:02

Re: FUN WITH FLAGS - game mode - description

Lewin, if that would have been already there - would you still demolish your coal mines to deny me a flag?
Of course, it was either that or you would have won ;)
Also, I wasn't in much of a position to destroy houses so I'd pretty much given up on the forechecking flag. But it would probably affect other people's decision to destroy buildings because -2 is a big penalty if you want to get that flag. It sounds good to me.

I think the changes sound good. An incentive not to starve your people is a good idea (lucky I made those changes so you can detect units starving to death).

I think we should try to play a few more test games in case there are bugs/issues remaining. Just let me know when suits you and I'll try to be online :)

Return to “Ideas / Suggestions”

Who is online

Users browsing this forum: No registered users and 9 guests