Author Topic: Programmer's help desk and resources  (Read 6561 times)

Offline JM Dragon

  • Stomp Arena Staff
  • this title came sooner than the last
  • **
  • Posts: 3629
Programmer's help desk and resources
« on: March 22, 2012, 12:03:15 AM »
Do you have any questions about programming, like how do I do (x), or what should I use for (y)? Feel free to ask them here. I (or someone else knowledgeable in the area) will be happy to answer your question.

Also, I'll keep a list of some helpful links here by category. Please suggest some more, because the more resources we have, the more helpful this topic might be.

Resources:
Java
  • Javanotes - An online textbook covering basic Java
  • Java 7 API - Documentation on how to use Java's standard library
« Last Edit: June 15, 2012, 11:10:42 PM by Big JM »
 

Offline AK712

  • Newbie
  • *
  • Posts: 19
  • Game Programmer
Re: Programmer's help desk and resources
« Reply #1 on: March 26, 2012, 05:00:08 PM »
Oooooo... where to begin....

Well, my biggest question would have to be creating level editors... I've heard it's rather difficult to code, and i've looked for tutorials online, or even people who have made them, but I can't seem to find anything... I need to create a level editor for some of my games, do you have any idea how I could work on that?
AK sayz *punch*

Ever tried Sauerbraten? No game in the world has beaten it yet. Only one that has come close is Legend of Zelda.

Super Mario War v1.8 Beta 2 FTW.

Offline JM Dragon

  • Stomp Arena Staff
  • this title came sooner than the last
  • **
  • Posts: 3629
Re: Programmer's help desk and resources
« Reply #2 on: March 26, 2012, 06:19:55 PM »
Quote from: AK712
Oooooo... where to begin....

Well, my biggest question would have to be creating level editors... I've heard it's rather difficult to code, and i've looked for tutorials online, or even people who have made them, but I can't seem to find anything... I need to create a level editor for some of my games, do you have any idea how I could work on that?

It's rather fortunate that I've been working on a level editor as well.
There's actually quite a bit of work that can go into a level editor. Before I go into details, though, may I ask what tools/ programming languages you are using for this project, and maybe some details on what you're expecting the levels to be like as well?
« Last Edit: June 16, 2012, 12:52:32 AM by Big JM »
 

Offline AK712

  • Newbie
  • *
  • Posts: 19
  • Game Programmer
Re: Programmer's help desk and resources
« Reply #3 on: April 01, 2012, 10:32:25 AM »
Right now, I'm working with Flash 8 Pro, which uses AS2. The levels are going to be 32 by 24 tiles, with every tile 20 by 20 pixels. This is for my Star Tower game I'm currently working on. I was thinking of seperate areas for blocks and enemies, maybe a bit like Super Mario War. I'm using all of the tiles from Super Mario War, plus maybe a few new ones from New Super Mario Bros. Currently only have 3 enemies (goomba, red koopa, green koopa) and the object of the game is a giant Star (not sure of size, 32 by 32 I think). It would be an in-game editor, if that's possible. If you need anymore descriptions of what it would be, I should be on here frequently.
AK sayz *punch*

Ever tried Sauerbraten? No game in the world has beaten it yet. Only one that has come close is Legend of Zelda.

Super Mario War v1.8 Beta 2 FTW.

Offline JM Dragon

  • Stomp Arena Staff
  • this title came sooner than the last
  • **
  • Posts: 3629
Re: Programmer's help desk and resources
« Reply #4 on: April 01, 2012, 09:02:01 PM »
I'm not sure how action script works, but the concept should be easy to translate.
The most important thing to consider with level editors is how to save map data for future use. You've made it pretty simple on yourself by using a tile based system. In this case, I would save the information related to the graphic of a tile(like x,y position on the image) in a list that closely resembles the tile array. For example:
Code: [Select]
for(int row = 0;row < 24;row++){
    for(int col = 0; col < 32;col++){
        save(tile[col][row].graphicX,tile[col][row].graphicY);
    }
}
To load it, you would just have to have a load function instead of a save function. It'll be different with each language.

After that, you could save all enemy positions, like this:
Code: [Select]
for every enemy:
   save it's type,x position, and y position

Once you have loading/ saving done, it should be simple to implement data manipulation. I would probably have a tile mode and enemy mode. For tile mode, this is probably how the code'll work:
Code: [Select]
when the mouse is clicked:
   //These values will be your mouse's relative x and y position. I'll refer to them as relX and relY.
   get the mouse x and y position, and divide them by 20, or whatever the tile width and height (respectively) will be.
   //this will be whatever mode the user is in. for placement mode, this'll overwrite the old tile with the tile the user selected.
   manipulate the data in tiles[relX][relY] according to the mode the user is in.
(you can also change the function depending on which button is pressed. The right mouse button makes a good delete button.)

For enemies, you might not need  to use the relative coordinates, but you'll need to detect whether or not they will be in a tile.


In all honesty, the level editor is only going to be as complicated as the game it is being used for. If you use a Game Maker file, I have an (extremely old) project that had a simple level editor in it, but it isn't the best source to use. It might be worth a look, if you want it.
 

Offline AK712

  • Newbie
  • *
  • Posts: 19
  • Game Programmer
Re: Programmer's help desk and resources
« Reply #5 on: August 03, 2013, 02:49:03 PM »
Thanks JM, that has helped a lot. I have another question. Do you know how to save certain variables to the computer so that they could be retrieved every time the game is loaded?
AK sayz *punch*

Ever tried Sauerbraten? No game in the world has beaten it yet. Only one that has come close is Legend of Zelda.

Super Mario War v1.8 Beta 2 FTW.

Offline Felix-The-Ghost

  • Too Much Free Time
  • *****
  • Posts: 1306
  • 1v1 Rust
    • http://members.allegro.cc/felix-the-ghost/index.html
Re: Programmer's help desk and resources
« Reply #6 on: August 04, 2013, 05:49:35 PM »
Learn how to output text files and read them back in in your language of choice. Encryption is available to make it harder for users to modify.

Offline Nisaba

  • Newbie
  • *
  • Posts: 3
    • pckf
Re: Programmer's help desk and resources
« Reply #7 on: January 31, 2016, 06:43:28 AM »
let me introduce myself. I'm Nisaba, coming from the pckf-forum.
I'm about to do a smw-mod mashed up with the commander keen graphics, sprites, sounds, tilesets etc.
presumably I'm going to edit the source-code as well, but one step at the time.
to give you a glimpse of what this is all about check this screenshot.

my first question to you:
can you name me an editor for those .TLS files (tile_animation_tileset, etc.)? so I can add some further hazards instead of editing existing once.

thanx in advance

ps.: maybe I overlooked a thread already dealing with this kind of request. but as far as I can ascertain, there is no such topic. in case there is please pardon my mortal inattentiveness.
.brought to you by Sklargifax Space Industries

Offline fluffypillow

  • Regular
  • *****
  • Posts: 136
    • smwstuff.net
Re: Programmer's help desk and resources
« Reply #8 on: February 01, 2016, 05:27:30 PM »
Hi, the TLS files are binary files, storing how each tile on the tileset image behaves (eg. solid, ice, kills the player, ...). There's no editor for it, but you probably don't have to touch it; just draw your own tileset image. If you want to add new hazards, you will have to edit the source code, and draw new graphics for it.
smwstuff.net
Working on: Netplay, Content hosting site, asm.js port

Offline Nisaba

  • Newbie
  • *
  • Posts: 3
    • pckf
Re: Programmer's help desk and resources
« Reply #9 on: February 04, 2016, 07:36:14 AM »
Hi fluffypillow, thanx for the response.

so right now I'm digging in the source-code, fiddling around. I think I've spotted some parts which I was looking for. yummy, yummy!

but of course another problem needs to be tackled. and therefore I might need a hint of yours. until now I compiled files on a linux base. but I truly have not a glimpse of an idea how to deal with this makefile in a windows environment (since I need -inter alia- an *.exe file for my fellow pckf members).
I'm seeking advice! If it weren't for my stupidness I wouldn't ask for help. which tools... which way... how to...

ps.: another sneak preview
.brought to you by Sklargifax Space Industries

Offline fluffypillow

  • Regular
  • *****
  • Posts: 136
    • smwstuff.net
Re: Programmer's help desk and resources
« Reply #10 on: February 04, 2016, 04:04:25 PM »
Are you using the official 1.8 source or one of the forks (eg. my version from GitHub)?

The 1.8 has Visual Studio project files in the 'Projects/PC' directory, though I don't know if that works. If you don't use VS, you can try importing the project into other IDEs, like CodeBlocks, which has a tutorial here: http://wiki.codeblocks.org/index.php/Code::Blocks_and_Makefiles . You can also install the Linux tools, which you might be more familiar with. MSYS2 (https://msys2.github.io/) might be a good choice then.

If you use another version, which uses CMake (that is, it has a CMakeLists.txt in its root dir), then download CMake (https://cmake.org/), it's a project file/makefile generator. Choose SMW's directory, and another directory for the build files, and press Configure. It will ask you what kind of project file you want, choose the one you'd like (eg. if you use VS, it can generate VS project file, but you can also create Makefiles too). If everything's ok, click Generate. You can now use the generated project file/makefile the usual way.

Note that unless you use MSYS2's package manager, you will have to manually set up the SDL libs (downloading them and adding their paths in your IDE).

smwstuff.net
Working on: Netplay, Content hosting site, asm.js port

Offline Nisaba

  • Newbie
  • *
  • Posts: 3
    • pckf
Re: Programmer's help desk and resources
« Reply #11 on: February 04, 2016, 05:27:25 PM »
well now. thanx a lot for all that helpful information.
unfortunately I'm not able to test any of these suggestions by now. but as soon as I have the time to do so, I going to give an  immediately process update. 
so again: many thanks!

ps.: I do have the official 1.8 source as well as the version from GitHub
.brought to you by Sklargifax Space Industries