October 31, 2005, 15:35
|
#1
|
|
King
Local Time: 16:24
Local Date: July 29, 2010
Join Date: Mar 2003
Location: Cleveland, Ohio
Posts: 2,203
|
Using CSPL to Create an Event File For ToT
I was bored today at work (the halloween party ended at 2pm) so I went digging around and found Angelo Scotto's disertation on using CSPL (C Programming) to write a program that would hex edit the ToT source while the game is running.
Just a bit curious, but has anyone actually compiled anything using this? If I were to ever use this useful little thing I'd feel a lot better seeing it in action rather than making it from scratch.
|
|
|
|
October 31, 2005, 15:44
|
#2
|
|
Warlord
Local Time: 16:24
Local Date: July 29, 2010
Join Date: May 2001
Location: Greenville, SC
Posts: 107
|
DarthVeda used it in Kyokujitsu (WWII scenario from Japan's perspective). He used it to attach the four different maps end-to-end rather than on top of each other. As to how he did this, I couldn't tell you.
|
|
|
|
October 31, 2005, 15:56
|
#3
|
|
King
Local Time: 16:24
Local Date: July 29, 2010
Join Date: Mar 2003
Location: Cleveland, Ohio
Posts: 2,203
|
Did he ever complete that? His website says negative. http://www.darthveda.com/kyokujitsu/index.html
|
|
|
|
October 31, 2005, 16:02
|
#4
|
|
Warlord
Local Time: 16:24
Local Date: July 29, 2010
Join Date: May 2001
Location: Greenville, SC
Posts: 107
|
No. he didn't,  but what he did write is quite playable.
|
|
|
|
October 31, 2005, 16:06
|
#5
|
|
King
Local Time: 16:24
Local Date: July 29, 2010
Join Date: Mar 2003
Location: Cleveland, Ohio
Posts: 2,203
|
Ok, I'll take a look at what he did. I'll probably keep this in mind for the future. Thanks for your help
|
|
|
|
October 31, 2005, 19:07
|
#6
|
|
Emperor
Local Time: 15:24
Local Date: July 29, 2010
Join Date: Apr 1999
Location: of the frozen North.
Posts: 4,193
|
1. Years ago I got Angelo to write a little CSPL thing for an early attempt at a Russian Civil War scenario. It worked for the prototype scenario, but I couldn't get it to work for the final product. It changed event created caravans to a commodity other than 'hides'.
2. Kull did a lot of work writing the manuals for CSPL. He's a good person to ask about it.
3. Darth Veda didn't use CSPL to make the maps continuous. He used round world maps linked so one seemingly started at the same point where the next one seemingly ended. So you used a row of teleporters to move to the next map and keep going. I believe this technique was developed by Mercator.
|
|
|
|
November 1, 2005, 11:52
|
#7
|
|
King
Local Time: 16:24
Local Date: July 29, 2010
Join Date: Mar 2003
Location: Cleveland, Ohio
Posts: 2,203
|
CSPL seems to open a few more doors for scenario designers. I can see some really neat additions if we choose to use this program. I'm sure Gold Gulch, with all its special events would benefit profusely.
As for #3, that's kind of neat. Each map will look kind of weird I surmise as each hemisphere would be a cylindrical map, but the benefits are decent. This approach would increase the playable map for a huge increase in tiles and could potentially bar certain units from "theatres of war"
|
|
|
|
November 1, 2005, 13:33
|
#8
|
|
Moderator
Local Time: 22:24
Local Date: July 29, 2010
Join Date: May 2002
Location: Spamingrad
Posts: 5,693
|
CSPL is one of those untapped forces that may add so much to the CIV experience.
We should try some experiments...!
|
|
|
|
November 1, 2005, 13:36
|
#9
|
|
Emperor
Local Time: 23:24
Local Date: July 29, 2010
Join Date: Dec 1969
Posts: 3,079
|
|
Quote:
|
Originally posted by techumseh
3. Darth Veda didn't use CSPL to make the maps continuous. He used round world maps linked so one seemingly started at the same point where the next one seemingly ended. So you used a row of teleporters to move to the next map and keep going. I believe this technique was developed by Mercator.
|
I think it was William Keenan who developed it. At least, if I recall correctly, he was the one who "hired" me for that "Multi-Linked World Map Project" that didn't quite get anywhere (partly due to me, I suppose). But it didn't actually need to get anywhere, because a little while later gigamaps were discovered. And with a gigamap we could suddenly make a huge world map without having to stitch 3 maps together. (Yes, that's 3 maps. If you want a round map, you'll need the 4th to have the left and right edge line up again.)
The biggest problem with this, though, is that the AI won't know how to deal with this. It's unlikely to be using the transporters (properly).
That's something to keep in mind when using CSPL to get ambitious. The AI still is just as stupid.
I should probably get in touch with Angelo Scotto, though. I recently had a look at the Civ2 memory for a bit and found the offsets for the map section in memory. He didn't find those, so CSPL is kind of guessing to find it.
|
|
|
|
November 1, 2005, 13:45
|
#10
|
|
King
Local Time: 16:24
Local Date: July 29, 2010
Join Date: Mar 2003
Location: Cleveland, Ohio
Posts: 2,203
|
Interesting... Too bad size is such a factor in the game. Too much and the game is near unplayable...
|
|
|
|
November 1, 2005, 19:25
|
#11
|
|
King
Local Time: 16:24
Local Date: July 29, 2010
Join Date: Jan 2001
Location: of underdogs
Posts: 1,774
|
At the very earliest stages of El Aurens, I experimented with CSPL (using Kull's manuals  ). Initially, I had a list of several routines I wanted to invoke to simulate lack of supply and artillery fire. In the end I couldn't get even the simplest one, artillery fire, to work. Darthveda succeeded a bit with CSPL, because he can program in C++. I failed because I can't, and Angelo was simply too busy to go through a lengthy debugging process. In its current form CSPL cannot be used by anyone who doesn't speak C++.
|
|
|
|
November 2, 2005, 22:25
|
#12
|
|
King
Local Time: 14:24
Local Date: July 29, 2010
Join Date: Mar 1999
Location: El Paso, TX USA
Posts: 1,751
|
Update CSPL
I did some follow up on CSPL with Angelo over a year ago. Here's the text of our two emails:
|
Quote:
|
Hi Angelo,
Long time no talk, old bud! Brian Mason (Tecumseh) is building a new Tot Scenario, and asked me to develop some CSPL events for it. Despite assisting you with the manual, I'd never seriously tried to build CSPL events for a real scenario, but I've been disappointed that no one else has released a CSPL scenario, and figured, "why not?"
So I broke out the manual and followed all the steps to get things set up, but in the end I could never get CSPL to compile properly. At first the batch file wouldn't run at all, but I made a few edits and that got thing working somewhat, but the compile process always resulted in a host of errors. I suspect this might have something to do with the fact that I'm using WinXP (which didn't exist when you created CSPL), but my C++ knowledge is too limited to say for sure. (I am using the recommended version of Borland, so that shouldn't be an issue.)
Anyway.....I was hoping you might be able to run a test of your last version of CSPL on a WInXP machine to see if it works, and maybe provide some pointers to help me get started. I'm sure you're busy and won't be bugging you to create any events, but just need help to get the program running.
Many Thanks, Paul
|
And his reply....with attachment!
|
Quote:
|
Phew, sorry if it took me so long but WinXP exposed a very strange behaviour with this script, definitely i need to upgrade CSPLCompanion to WSH (even if few people will use CSPL, having it working is a good thing ;o) )
Aside from having CHOICE.com I had to remove “ characters from BORLANDPATH and CSPLPATH, and I needed to explicitely add path to includes and libraries that comes from Borland C++ compiler.
To make it work you should open the bat file I’m sending to you and change BORLANDPATH and CSPLPATH (which now are pointing to C:\windows\temp\borland and C:\windows\temp\cspl) to your paths, I really think this fix couldn’t work if your BORLANDPATH or CSPLPATH has blank spaces in their name but I’ve not tested it.
As soon as I find some time I’ll move it to WSH (probably JScript) and this should solve our problems once for all.
Ciao, Angelo
|
Unfortunately I can't recall the results of testing the new CSPL, and I never did get back with Angelo to see if he'd done anything further with the code. I suggest you guys try out the updated CSPL and if there's a desire to pursue this seriously, I can provide Angelo's email address.
|
|
|
|
November 2, 2005, 22:31
|
#13
|
|
King
Local Time: 14:24
Local Date: July 29, 2010
Join Date: Mar 1999
Location: El Paso, TX USA
Posts: 1,751
|
While running the failed WinXP experiments, I created a text file to capture my comments on problems with the code and the manual. See attached.
Last edited by Kull; November 2, 2005 at 23:40.
|
|
|
|
November 2, 2005, 22:45
|
#14
|
|
King
Local Time: 14:24
Local Date: July 29, 2010
Join Date: Mar 1999
Location: El Paso, TX USA
Posts: 1,751
|
As far as I know, this is the most recent released version of CSPL (but you'll need to replace the v0.1 csplcompanion.bat with the v.02 poated above. One other known problem. "Images" is a child folder of "Doc", not "Manual" (just drag it to the correct location)
|
|
|
|
November 5, 2005, 21:40
|
#15
|
|
Emperor
Local Time: 17:24
Local Date: July 29, 2010
Join Date: Dec 1969
Location: Baltimore, MD
Posts: 4,325
|
|
Quote:
|
Originally posted by Mercator
The biggest problem with this, though, is that the AI won't know how to deal with this. It's unlikely to be using the transporters (properly).
|
Yep. That's the drawback. You basically have to script four maps seperately.
Kyokujitsu was definately way too ambitious of a project for me to complete in a timely fashion. CSPL is very powerful, I can't remember exactly what I was using it to do, but it was quite nice.
|
|
|
|
November 12, 2005, 20:06
|
#16
|
|
Emperor
Local Time: 23:24
Local Date: July 29, 2010
Join Date: Dec 1969
Posts: 3,079
|
I ended up working on CSPL for a bit tonight...
I updated the CSPLcompanion.bat according to your/his zip and fixed the choice thing too. I found out a way to do the choice thing in Windows XP, without using choice.
I also solved all those things you mentioned in the CSPL fixes file. The manual had a whole bunch more errors too, I fixed those as well. I also took the liberty to adjust the images used in the manual. I cropped them a little bit and made their file size a lot smaller. so the entire download is now less than half the original size (more than 2/3 of the entire package was due to 3 big images used for the manual).
Here's the update:
http://apolyton.net/upload/view.php?file=859_CSPL.zip
|
|
|
|
November 13, 2005, 04:24
|
#17
|
|
Moderator
Local Time: 22:24
Local Date: July 29, 2010
Join Date: May 2002
Location: Spamingrad
Posts: 5,693
|
Can anyone mention what kind of 'events' are possible with CSPL?
|
|
|
|
November 13, 2005, 10:58
|
#18
|
|
King
Local Time: 14:24
Local Date: July 29, 2010
Join Date: Mar 1999
Location: El Paso, TX USA
Posts: 1,751
|
|
Quote:
|
Originally posted by Mercator
I ended up working on CSPL for a bit tonight...
I updated the CSPLcompanion.bat according to your/his zip and fixed the choice thing too. I found out a way to do the choice thing in Windows XP, without using choice.
I also solved all those things you mentioned in the CSPL fixes file. The manual had a whole bunch more errors too, I fixed those as well. I also took the liberty to adjust the images used in the manual. I cropped them a little bit and made their file size a lot smaller. so the entire download is now less than half the original size (more than 2/3 of the entire package was due to 3 big images used for the manual).
Here's the update:
http://apolyton.net/upload/view.php?file=859_CSPL.zip
|
Nice work. Much cleaner presentation!
Curt: Think of CSPL as "on-the-fly" hex editing of the game, while it's in process! (as opposed to editing a dormant save file). As a result, almost anything you can imagin, can be achieved. See my next post for more details.
|
|
|
|
November 13, 2005, 11:05
|
#19
|
|
Emperor
Local Time: 15:24
Local Date: July 29, 2010
Join Date: Apr 1999
Location: of the frozen North.
Posts: 4,193
|
CSLP, as I understand it, is an external program that runs simultaneously with ToT. It hex-edits the save file as you go.
The manual that comes with CSLP describes very generally the types of events possible with CSPL:
|
Quote:
|
UNITS thread: is the thread which scans (read and write) units from Civ memory
CITIES thread: is the thread which scans (read and write) cities from Civ memory
GLOBAL thread: is the thread which scans (read and write) game's global variables (Difficulty Level,Barbarian Activity,etc...) from Civ memory
WONDERS thread: is the thread which scans (read and write) wonders from Civ memory
MAPS thread: is the thread which scans (read and write) maps data structure from Civ memory
CIVS thread: is the thread which scans (read and write) civilizations from Civ memory
ATTACKS thread: this thread is used to manage attacks: it run continuosly and, when a battle take place, store infos about winner and loser units.
|
Beyond that, Curt, I don't really know specifically what events are possible, except I think it's very broad and well beyond what's possible with the built-in events.
|
|
|
|
November 13, 2005, 11:21
|
#20
|
|
King
Local Time: 14:24
Local Date: July 29, 2010
Join Date: Mar 1999
Location: El Paso, TX USA
Posts: 1,751
|
CSPL Example (a program by Angelo)
I recently discovered a small program from Angelo, called the "CSPL Example Save Game". To help show some of the possibilities of CSPL, he created four small events and compiled them into a CSPL executable. The readme notes that was only tested in Win98, but I just ran it in winXP and it worked fine. If you're interested, here's CSPL in action:
1) Unzip into any folder on your computer (location is meaningless).
2) Launch ToT
3) Open the file "cspltest.sav" (it's in the new folder)
4) Launch the CSPL 4-event program, "csplclient.exe" (also in the new folder)
5) Open the file "readme.txt" (also in the new folder)
6) You could read the whole thing, but to run the test, move to the section titled "FEATURES OF THIS EXAMPLE PROGRAM" and follow his directions. The four events demonstrate:
- seamless movement from one map to another (without the teleport links ala Kyokujitsu)
- units which can't be built unless an improvement is present in the city.
- units which can change from one type to another at the press of a key
- an event triggered by the movement of a unit into a specific hex.
Hopefully this will help folks visualize some of the infinite possibilities inherent in CSPL. The Civ2 community may never get the source code, but this is definitely a close second. Speaking of which - if we can't find programmers willing to tackle CSPL, what hope is there of getting people with the exact same skills to work on the source?
|
|
|
|
November 13, 2005, 12:18
|
#21
|
|
Emperor
Local Time: 15:24
Local Date: July 29, 2010
Join Date: Apr 1999
Location: of the frozen North.
Posts: 4,193
|
Maybe this is "the" project, then.
|
|
|
|
November 13, 2005, 12:33
|
#22
|
|
Emperor
Local Time: 23:24
Local Date: July 29, 2010
Join Date: Dec 1969
Posts: 3,079
|
Re: CSPL Example (a program by Angelo)
|
Quote:
|
Originally posted by Kull
Nice work. Much cleaner presentation!
|
Thanks. For the presentation I just made the screenshots fit on the screen and fixed those wrongly layed-out sections in chapter 3. Preformatted code still screws things up sometimes.
I haven't actually ever tried CSPL. I didn't test the changes to the batch file either, except to make sure the menu worked, so I hope it works. The 2 environment variables I also left like in the 0.2 version. So they still need to be edited.
I'll have to have a look at that example later.
|
Quote:
|
Originally posted by Kull
Hopefully this will help folks visualize some of the infinite possibilities inherent in CSPL. The Civ2 community may never get the source code, but this is definitely a close second. Speaking of which - if we can't find programmers willing to tackle CSPL, what hope is there of getting people with the exact same skills to work on the source?
|
Zero. We hardly have any people capable of editing a wiki page, making a website, let alone hex-editing or programming. And those who do tend to be ones who've all but lost interest in Civ2 (e.g. me, St Leo, Catfish and Angelo Scotto).
|
|
|
|
November 13, 2005, 22:13
|
#23
|
|
King
Local Time: 16:24
Local Date: July 29, 2010
Join Date: Mar 2003
Location: Cleveland, Ohio
Posts: 2,203
|
Ahem. I know HTML and how to work a Wiki page. Agricola and Curt know hex-editing. I believe we can find a way.
@Curt: Think of this: What do we mainly hexedit? The Global Warming Trigger. Now, do you remember that old Harrison Ford movie called "Force 10 from Navarone"? ( http://www.imdb.com/title/tt0077572/ ) In the movie the Allied team aims to take out a dam and destroy a bridge blocking the Germans from invading part of Yugoslavia.
Now let's say we have a scenario that aims to depict a raid on hydroelectric dam and a major bridge. The object for the player is to blow up the dam, release the water, and take out the bridge.
We start off by hexediting the global warming trigger out of the game and placing a bunch of pollution tiles on the map. Then we create an event called "explosives ignite" when the damn trigger unit is killed and CSPL hexedits global warming back into the game. With sufficient pollution tiles on the map global warming occurs and the areas surrounding the dammed river change to "flooded land".
|
|
|
|
November 14, 2005, 05:13
|
#24
|
|
Moderator
Local Time: 22:24
Local Date: July 29, 2010
Join Date: May 2002
Location: Spamingrad
Posts: 5,693
|
Excellent idea!
The trigger alone could have many uses, such a 'black death'
-type plague or a magic ice age in a fantasy scenario...
|
|
|
|
November 14, 2005, 07:09
|
#25
|
|
Emperor
Local Time: 23:24
Local Date: July 29, 2010
Join Date: Dec 1969
Posts: 3,079
|
@Harry: Excellent idea... But why make it so hard on yourself? You'd be relying on the inner workings of global warming. The advantage of CSPL is that you don't have to do that anymore. You could just as easily use CSPL to simply change large swaths of terrain into the terrain you want.
E.g. as one of the examples Kull gave, an event can be triggered when a unit enters a square. You could have a huge well-defended area full of Germans. It's your task to get one of your men onto the dam tile. You could even represent getting inside the dam by using multiple maps.
The dam square is a transporter which gets you to a second map, inside the dam. Upon entering you use CSPL to change the unit to one with higher movement rate, so you can increase the scale of the inside of the dam (if necessary). When your unit reaches the right square, the terrain changes.
Even better, say, when you enter the trigger square an immobile explosive device unit is created on it and it has to remain in that square for X turns (and not be found by Germans, that is), after which it will "explode". and cause the terrain changes.
You could even spread the terrain changes over several turns. First the dam itself will "flood", then the area around it will gradually be flooded, say, giving your men enough time to get to "higher ground" (I forgot the exact plot of the movie, haven't seen it in a while).
|
|
|
|
November 14, 2005, 10:08
|
#26
|
|
Emperor
Local Time: 15:24
Local Date: July 29, 2010
Join Date: Apr 1999
Location: of the frozen North.
Posts: 4,193
|
Most of that could be accomplished within the existing events structure of ToT. You would have to use an invisible '0' strength trigger unit, but otherwise it's doable.
I'm intrigued by Kull's idea that we could limit production of certain units to cities with specific improvements, eg. only cities with factories could produce artillery or tanks. This is something I've been wishing for for awhile.
|
|
|
|
November 14, 2005, 10:27
|
#27
|
|
Emperor
Local Time: 23:24
Local Date: July 29, 2010
Join Date: Dec 1969
Posts: 3,079
|
|
Quote:
|
Originally posted by techumseh
Most of that could be accomplished within the existing events structure of ToT. You would have to use an invisible '0' strength trigger unit, but otherwise it's doable.
|
 Maybe so, but the ChangeTerrain action is very limiting. And using CSPL you wouldn't have to worry about reaching the maximum event space.
|
|
|
|
November 20, 2005, 01:48
|
#28
|
|
Emperor
Local Time: 15:24
Local Date: July 29, 2010
Join Date: Apr 1999
Location: of the frozen North.
Posts: 4,193
|
I've been thinking about this CSLP thing. I'm no programmer, so my idea may be unrealistic. And I'm sure that Jorrit is correct about the lack of people with skills that are still interested in Civ2. But when have we ever let the cold winds of reality stop us?
Would it be possible to create a stock program based on CSLP which could be used with any scenario? There would be some fields that needed to be filled in I'm sure, eg. the name of the scenario.
If this were possible, then a few standard functions could be established for starters - such as changing units into something else if a trigger is hit, or allowing specific units to be created only in cities with a certain improvement. The specific event types could be determined later. I'm just wondering if the concept of a derivative program that would be useable by someone without programming experience on any scenario has merit?
|
|
|
|
November 20, 2005, 20:08
|
#29
|
|
Emperor
Local Time: 23:24
Local Date: July 29, 2010
Join Date: Dec 1969
Posts: 3,079
|
Well, that would be possible, but then it would require programming to make that program. And I think there was a reason Angelo Scotto didn't go so far as to make that thing himself.
I had a look at that example program, by the way. I think it might actually have been the first time I saw CSPL in action. And to be honest, it was rather sluggish and flukey.
Oh, and it's CSPL.
|
|
|
|
November 20, 2005, 21:20
|
#30
|
|
Emperor
Local Time: 15:24
Local Date: July 29, 2010
Join Date: Apr 1999
Location: of the frozen North.
Posts: 4,193
|
And I'm cixelsid!
|
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is On
|
|
|
All times are GMT -4. The time now is 17:24.
|
|