New to Stratagus

RichLongess
Posts: 5
Joined: Fri Nov 07, 2014 12:16 pm

New to Stratagus

Post by RichLongess »

I have been wanting to make a 2-D RTS and Stratagus was recommended to me. It seems really great.

I've got a lot of graphics made, and lists of what I want my game to do. I'm just guessing, but I'm assuming this would be a good plan for me:

1. Re-skin and existing game
2. program different scenarios
3. Customize the A.I.

I've been looking over the old threads and I can't find one that just spells it all out in one place - how do you get started modifying an existing game or creating a new one? I am willing to spend the effort to learn, but it would probably save me six months if there were at least a list of what I needed to learn, much less documentation or a tutorial, both of which seem not to exist.

So:

1. I've got tile sets and sprites, where do I put them to re-skin a game.
2. I found a page of scripts, would reading all of those be the best place to start learning to make scenarios?: http://stratagus.com/scripts/
3. Are there discussions of AI anywhere?

Thank you, you all seem to be a very well-established community. I'm glad to have found you.

Rich
User avatar
Andrettin
Posts: 433
Joined: Sun Jun 30, 2013 9:58 pm
Location: Vienna, Austria
Contact:

Re: New to Stratagus

Post by Andrettin »

RichLongess wrote:I have been wanting to make a 2-D RTS and Stratagus was recommended to me. It seems really great.

I've got a lot of graphics made, and lists of what I want my game to do. I'm just guessing, but I'm assuming this would be a good plan for me:

1. Re-skin and existing game
2. program different scenarios
3. Customize the A.I.

I've been looking over the old threads and I can't find one that just spells it all out in one place - how do you get started modifying an existing game or creating a new one? I am willing to spend the effort to learn, but it would probably save me six months if there were at least a list of what I needed to learn, much less documentation or a tutorial, both of which seem not to exist.

So:

1. I've got tile sets and sprites, where do I put them to re-skin a game.
2. I found a page of scripts, would reading all of those be the best place to start learning to make scenarios?: http://stratagus.com/scripts/
3. Are there discussions of AI anywhere?

Thank you, you all seem to be a very well-established community. I'm glad to have found you.

Rich
Hello Rich, welcome to the Stratagus forums!

You can find documentation for the engine here:
http://bazaar.launchpad.net/~stratagus/ ... /head:/doc

To add tilesets and unit graphics, you have to put the graphics somewhere in the /graphics/ subfolder, and then configure the scripts to make use of them. Keep in mind that tilesets and unit graphics need to be indexed to a palette.

To make a map, the easiest way is to make use of the map editor which is included in most Stratagus engine games. If you want to make something more complex for a scenario, you would have to make use of triggers (you would have to edit the map file manually to add triggers to it).

If you have any further questions, don't hesitate to ask!
User avatar
Kyran
Posts: 499
Joined: Sat Dec 31, 2011 5:19 pm
Location: Australia
Contact:

Re: New to Stratagus

Post by Kyran »

RichLongess wrote:1. Re-skin and existing game
I recommend Aleona's Tales. It is Wargus with free graphics. Everyone here is familiar with it.
RichLongess wrote:1. I've got tile sets and sprites, where do I put them to re-skin a game.
The scripts for the tilesets are located in /scripts/tilesets, the individual script files define the location of their graphics (generally somewhere in /graphics/tilesets/).
RichLongess wrote:2. I found a page of scripts, would reading all of those be the best place to start learning to make scenarios?: http://stratagus.com/scripts/
Look at existing examples. Here is an old tutorial. The Frontier Force campaign has a few custom bits, as does For the Motherland scenarios.
RichLongess wrote:3. Are there discussions of AI anywhere?
There are a few around. Here is one.

We have a Skype group. You can also ask questions there.
04:27 jim4 why haven't you added wc1 support? this project sucks. i'm only going to use freecraft
05:06 jim4 finished wc1 support yet? i've been waiting for 6 years
05:10 jim4 new things scare me
RichLongess
Posts: 5
Joined: Fri Nov 07, 2014 12:16 pm

Re: New to Stratagus

Post by RichLongess »

I have a background QBASIC programming, which doesn't seem too helpful.
I also know some ancient Greek, and its not helping either...

The tutorial says step one, make a map. I'm stuck there.
So when I take a new tileset that isn't in the game and attempt to add it, how do I do it?

I'm looking at AT right now. I've opened a script for a tileset and I don't understand what I'm looking at.
For example, what am I looking at here:

"solid", { "light-grass", "land",
{ 356, 357, 356, 0, 358, 359, 360, 361, 362, 363, 358, 359, 358, 359, 358, 359}}, -- 050

I'm guessing that since the tilesets are all crammed together in one PNG file, these scripts are giving the coordinates for each tile, and saying what that tile is (ie, this is a water tile, and its unpassable).

When I look at my new tileset, how do I determine the coordinates to enter in the script?
User avatar
Andrettin
Posts: 433
Joined: Sun Jun 30, 2013 9:58 pm
Location: Vienna, Austria
Contact:

Re: New to Stratagus

Post by Andrettin »

RichLongess wrote:I have a background QBASIC programming, which doesn't seem too helpful.
I also know some ancient Greek, and its not helping either...

The tutorial says step one, make a map. I'm stuck there.
So when I take a new tileset that isn't in the game and attempt to add it, how do I do it?

I'm looking at AT right now. I've opened a script for a tileset and I don't understand what I'm looking at.
For example, what am I looking at here:

"solid", { "light-grass", "land",
{ 356, 357, 356, 0, 358, 359, 360, 361, 362, 363, 358, 359, 358, 359, 358, 359}}, -- 050

I'm guessing that since the tilesets are all crammed together in one PNG file, these scripts are giving the coordinates for each tile, and saying what that tile is (ie, this is a water tile, and its unpassable).

When I look at my new tileset, how do I determine the coordinates to enter in the script?
You have to count tiles (beginning from 0) from left to right, up to down, until you reach the tile you want. So, for instance, if you have 16 tiles in each row, then the first tile of your third row will be tile 32.

The first text "tag" in the solid tile type's definition (the "light-grass" in your example) is the tile type's name. The ones after that describe what it is (i.e. if it is a rock, a tree, and etc.), as you correctly supposed.

What size are your tiles, by the way?
RichLongess
Posts: 5
Joined: Fri Nov 07, 2014 12:16 pm

Re: New to Stratagus

Post by RichLongess »

uh-oh, I hope I got lucky...my tiles are 16 pixels square. It looks like 32 is standard?

What do all the other things mean? Are the "solid / light grass / land" just tags to read in the programming, or do they tell the game how the tile functions? and all of those numbers in the 300s?

Thank you for helping me out.
User avatar
Andrettin
Posts: 433
Joined: Sun Jun 30, 2013 9:58 pm
Location: Vienna, Austria
Contact:

Re: New to Stratagus

Post by Andrettin »

RichLongess wrote:uh-oh, I hope I got lucky...my tiles are 16 pixels square. It looks like 32 is standard?

What do all the other things mean? Are the "solid / light grass / land" just tags to read in the programming, or do they tell the game how the tile functions? and all of those numbers in the 300s?

Thank you for helping me out.
You are welcome =)

32 is the standard size, yes. The engine can accept any size of tile though if you add code like the following to the tileset's definition:

Code: Select all

DefineTileset("name", "Forest",
  "image", "tilesets/forest/terrain.png",
  [b]"size", {16, 16},[/b]
  -- Slots descriptions
  "slots",
However, there was bug with difference tile sizes which was only fixed recently (it might still be present in the version of Aleona's Tales you are using).

The Wyrmsun executable already has that bug fixed, you can get it here (click on "Raw" to download it):
https://github.com/Andrettin/Wyrmsun/bl ... yrmsun.exe

It should be able to run Aleona's Tales (just put it in AT's main folder, and run it instead of the normal executable that comes with Aleona's Tales), since as far as I can recall I didn't break compatibility when modifying the engine for Wyrmsun.

The numbers in the 300s are just the same as the others, they use tile 300-something of the tileset's image.

"solid" means that that tile type slot only contains one tile type (that is, it is not a transition tile). The slots where it is written "mixed" at the end handle transitions from one tile type to another. "light-grass" is just that tile type's name, it could be changed to anything else (but don't forget that the name needs to be the same for its the "mixed" tile type slots which have transition from "light-grass" to other things). "land" means that it is a land tile type (that is, one that is neither water nor coast); IIRC it also allows land units to walk through it (unless the "unpassable" flag is also present).
RichLongess
Posts: 5
Joined: Fri Nov 07, 2014 12:16 pm

Re: New to Stratagus

Post by RichLongess »

I see the term "unused" a lot in the scripts. I can't find what this means.

Also, If there will not be choppable trees on this tileset, do I need to delete this section:

-- Slots descriptions
"slots", { "special", { -- Can't be in pud
"top-one-tree", 121, "mid-one-tree", 122, "bot-one-tree", 123,
"removed-tree", 126,
"growing-tree", { -1, -1 },
"top-one-rock", 161, "mid-one-rock", 162, "bot-one-rock", 163,
"removed-rock", 166 },
User avatar
Andrettin
Posts: 433
Joined: Sun Jun 30, 2013 9:58 pm
Location: Vienna, Austria
Contact:

Re: New to Stratagus

Post by Andrettin »

RichLongess wrote:I see the term "unused" a lot in the scripts. I can't find what this means.
It simply means that that particular tile type slot is not being used (there is a fixed number of tile type slots due to how the tileset is structured).
Also, If there will not be choppable trees on this tileset, do I need to delete this section:

-- Slots descriptions
"slots", { "special", { -- Can't be in pud
"top-one-tree", 121, "mid-one-tree", 122, "bot-one-tree", 123,
"removed-tree", 126,
"growing-tree", { -1, -1 },
"top-one-rock", 161, "mid-one-rock", 162, "bot-one-rock", 163,
"removed-rock", 166 },
Good question. I wouldn't delete it, but would instead change the numbers to "-1". If that causes the tileset to not work, I would put empty tiles' numbers there instead.
RichLongess
Posts: 5
Joined: Fri Nov 07, 2014 12:16 pm

Re: New to Stratagus

Post by RichLongess »

My original tileset did not have a solid coast tile. I merely had a water to shore transition and a shore to grass transition. I'm guessing this won't work since the game needs a solid to cue the transitions off of. So, I made some solid coast tiles and put them in at the end and added them into the script. But, is there a way to make it work without solid coast tiles?

Also, I'm not wanting any "dark coast", so I'm working on getting that out of the script as well.
Post Reply