Jump to content


PrimuS

Member Since 31 Dec 2008
Offline Last Active Yesterday, 12:16 PM

Topics I've Started

Ffsimf - Adlib Goodness In Your Games

01 May 2013 - 10:10 AM

ffsIMF v0.95

(yeah, really, that's the name)

Tested on GM81, also should work with :GM7: :GM8_new:

 

What is this?

ffsIMF is an IMFLib.dll wrapper extension. Basically, it lets you play .imf and .wlf AdLib music files. Those were used in many games by ID and Apogee in the early 90s: Wolfenstein 3D, Commander Keen, etc.

It better suits for playing .wlfs though.

 

How do i use it?

Just include the extension in your GM project, use imf_play(filename, false); to play a song once. Use imf_stop(); to stop it. That's it.

Other functions are described in readme.txt. An example (GM8.1) is also included, along with some music (by ID Software).

 

Where do i get it?

Here. (~235K)

(last updated 02.05.13 14:14 GMT+4)

 

Notes:

  • IMFLib.dll is included in the extension. It is placed into your game's working directory after startup, removed from there before shutdown. At least, it should be.
  • IMFLib.dll was created by Ripper of Chaos Software. I just modified it a bit and wrote a rather bad wrapper.
  • This thing is quite volatile, as it uses the WinAPI WaveOut. I'm afraid it might blow up. Use at your own risk.
  • imf_set_vol() actually sets the WaveOut volume, so everything using that will be affected (probably including GM's sound system).
  • Other information included in readme.txt.

Worms-like Terrain Generation

11 February 2013 - 07:50 PM

Worms-like Terrain Generation
GM Version: 8.1

Description:
Oh boy, here we go again.
So i was playing around with GM:S, trying to make something like Worms for Android, since the official Worms port there is apparently suspended or something, and i made this thing, tested it on Windows. Then i tested it on Android, and it didn't work properly at all. Guess it has something to do with using huge surfaces.

Anyway, i decided to port it to GM81. So here it is.
It's somewhat flexible (any map size, just place o_thing in that same room and it'll work) and you can tune the amplitudes n stuff easily, and textures, and outline colors. Done using paths. The biggest problem with this thing is that it cannot place parts of the map one above another, since i have no goddamn idea how to fill those spaces. Well, actually, i do, but i'm lazy to do that.

If you want, you can also place some sprites along the path, like those random objects sticking out of the terrain in Worms.

It's also not the best and fastest way to generate such terrains. The generator algorithm itself is quite lacking, actually.

Instructions:
A, D: move camera
SPACE: regenerate map

Download:
EXE + GM81 (~1.91MB): clicky

Screenies:
Spoiler

Can't set a precise collision mask

26 July 2012 - 02:30 PM

So i basically have this script:
surf = surface_create(w, h);
surface_set_target(surf);
draw_set_color(c_black);

//draw some stuff onto the surface

surface_reset_target();  
global.terrain = sprite_create_from_surface(surf, 0, 0, w, h, true, false, 0, 0);
sprite_collision_mask(global.terrain, 0, 0, 0, 0, 0, 0, 0, 0);
surface_free(surf);
The sprite comes out okay, transparent where it should be, etc.
But its collision mask is always a box. No matter what i try to do, it doesn't set a precise one.
I have the same script in GM81 working perfectly without sprite_collision_mask(), it just automatically sets the precise mask for that sprite. But in GMS it would always be a box, regardless of the collision_mask function.
If i draw a white rectangle to clear the surface like i did in the GM81 version, sprite doesn't even come out transparent, tho i set removeback to true, even if i draw a white point at the bottom left corner.
I'm not sure if this is a bug or just me being stupid, so i posted it here.
EDIT: Oh wait, it IS a bug. Any possible workarounds?
EDIT2: Well, removeback doesn't work even in sprite_add().

Keyboard aiming vs. mouse aiming

04 July 2012 - 06:18 PM

Say, we have a multiplayer Quake-like FPS with true-3D environments (ie multiple floors) and maybe even jumping. What suits it the best - full mouselook, just your plain Doom-like control scheme with slight autoaiming along the vertical axis, or manual vertical aiming using the keyboard?
I know what you'll answer, but it's nice IMO to have an FPS with teh good ol' keyboard controls to spice up things a bit.

Control scheme sample for teh second one:
  W         UP
A S D    LT DN RT

where:
W jumps, S shoots, A & D strafe left/right
Arrows control moving fwd/bwd and turning around.

YAMC - 2D Minecraft-Like World Generator

21 February 2012 - 08:17 PM

Yet Another Minecraft Clone v0.2 (in 2D)
GM Version: GM8.1

Description:
Your regular Minecraft-like 2D (Terraria-like, you could say) terrain generator that i've made in my spare time. Without caves. Just plain terrain. And it is pretty lousy, also. So why would you download it? Well, for one single reason.
It has infinite world generation (i hope it is truly infinite, lol). Well, that's not such a huge improvement over the others, but you may want to look at it.
It uses a kind of a chunk system as Minecraft had some time ago. The chunks are areas of the map 320x2048 (20x128 blocks; adjustable) - one view wide - in size. They contain all the blocks (duh) and, possibly, items, mobs, and everything else. Only three chunks of the map are present at the same time. When you leave a chunk beyond your 'render area' (that's three chunks currently: one behind the player, one where the player is currently situated, and one ahead), it gets saved as a simple binary file with its filename containing the chunk id (i.e. 0-320 will be the 0th chunk, -320-0 will be the -1th chunk, etc.) and all the stuff from that chunk gets deleted from memory, so your game would not lag. When a chunk enters your 'render area', it loads into memory, using that file that was saved previously. Or, if the chunk is actually completely new and no chunk file is present, it gets generated randomly. Pretty simple.
Oh, and it also has biomes. Three of them. And trees (if you can actually call these things trees. And flowers. And random seed support through the random_set_seed() function; it works almost as in Minecraft.

I'm not sure if that was done in GM before, lol. Thought someone would find it useful.

Instructions:
WASD - movement
LMB - place block
RMB - remove block
F - show/hide the debug info
R - return to the spawn
Terrain begins at y = 1024, so if you see nothing when you start the game, move down a bit.

Download:
Version 0.2. (.EXE + .GM81; ~1.8MB)

Changelog:
22.02.12 -- v0.2:
Spoiler


Known bugs:
- Seeds work pretty derpy, you can try fixing that by putting 'random_set_seed(global.map_seed)' in the beginning of the chunk_gen() script;
- After you reach distances that are ~15000 units away from your spawnpoint, some barely noticeable graphic artifacts begin to appear, like wobbly sprites and stuff. Tested on my PC only. Should be some GM bug;
- Only chunks (current_chunk - 2) and (current_chunk + 2) are cleared. That is enough when the player is moving smoothly, but when hopping distances wider than the chunk itself, it will leave uncleared chunks behind;
- Chunks do not get cleared when you teleport to the spawn (see the third bug);
Oh, and it does not overwrite previously saved worlds, if you select the same world folder at the start. Instead it loads them, but you can sure change the random seed at the start. So be careful with that.

Screenies:
Spoiler