Comments

Log in with itch.io to leave a comment.

Viewing most recent comments 1 to 12 of 32 · Next page · Last page

Dear Yal,

Few of the players of my game have found next bug:



When I removed all the hedge-objects from the level, another object has triggered this message:




Do you know, what could be the problem? Could you help?

(3 edits)

I did some googling and it looks like the issue is that the batch of trianges becomes so big the players' graphics cards can't handle it. (800 MB VRAM sound very small these days but ah well...) 

So we need to reset the drawing batch every 1000 triangles. I tried to figure out the easiest way to do that and here's my idea.

1) Create a new script with the following function:

function triangles_break_batch(quads=6){
     global.triangles_so_far += 2*quads
     if(global.triangles_so_far >= 1000){
         global.triangles_so_far -= 1000
         draw_flush()
     }
}

2) Init global.triangles_so_far to 0 somewhere before any 3D drawing, e.g. In CONTROL's create event.

3) Put this new triangles_break_batch function at the start of the Draw event of all terrain objects. You'd compute "quads" like so,

//For a block or wall
triangles_break_batch((image_xscale + image_yscale + image_xscale*image_yscale)*2)
//For a floor or slope
triangles_break_batch(image_xscale*image_yscale*2)

I am using GM:S 1.4, which does not have functions. I can change your code into script-like, but just to be sure: I shall change the "draw_flush()", and calling the new scipt I shall set the "quads" equal to 

(image_xscale + image_yscale + image_xscale*image_yscale)*2

for blocks and walls?

(2 edits)

Yes, just having a script asset with the same name should work too

  • change "quads" to "argument0" in the script
  • if draw_flush doesn't exist (it was added late in 1.4) overwriting the world matrix (e.g. by d3d_transform_set_identity or matrix_set) should also force a flush of the geometry buffer

Blocks/walls should use that formula, yes (they do indeed add that many triangles). Maybe slap a ceil() around the expression for stability so it always becomes an integer even if a block is e.g. 1.5x its base size. (If you never stretch things out in the room editor it gets easier, then you can just use the hardcoded number 12 for blocks and 4 for floors)

hey! didn't help :[

What exactly does the updated code look like? Are you using draw_flush or d3d_set_identity?

I find it a bit weird that it still tries to allocate a giant buffer of 1/6th of everything else it's rendering when it's totally fine with thousands of smaller ones, are you sure you didn't miss adding the safety code anywhere?

(3 edits)

dear Yal! thank you for the great-great engine you made. could you please tell me, where to determine the distance of object rendering (and which script de-renders them eg. behind your back)?

also, where engine determines the size of the 3d-camera (if I ex. want to have it in 1x1)?

(+2)
  • Distance for object rendering: CONTROL's Draw Event, controlled by "global.darkness" variable.
  • De-rendering things behind your back: CONTROL's Alarm 0 event. (It deactivates things outside your field of view at the same distance in all directions but you could adjust this using parent_camera.direction to take a step in the direction the camera is looking when computing the region to keep active)
  • The size of the camera is controlled by two things: obj_player's collision mask (currently a 8x8 sprite) which is used for collisions in the XY plane, and the zheight variable (the height along the Z axis) which is used for collisions on the Z axis, which defaults to 24 - the actual variable used to compute the camera perspective is zdelta but it's currently computed based on zheight (so the player's eyes will always be roughly where their head should be)
(2 edits)
dear Yal! thank you very much for helping with the first issue. still, i didn't get the second problem solved. changing the sprite of obj_player mask doesn't change the ratio in which the game automatically start. for example, it looks like it starts in 16:9 ratio (copying my monitor) and stays the same when I resize the window (look picture below). how could I change the ratio of the camera to eg. 1:1 or 4:3?



UPD: Could you also by any chance help me with importing other d3d-models in the game? I accept "no" as an answer. If you could, I will write the problem I am having.
(+1)

Oh, seems like I misunderstood your question! Aspect ratio of the in-game view, not the collision mask of the object.

  • For output window size, this is controlled by the Game Maker room viewport properties. The most important one is the first room of the game (titlescreen) because this room's viewport size sets the initial game window size when the game loads, but you should change all of them to use the desired window size (the fields for "width" and "height" for both camera properties and viewport properties)
  •  
  • After doing this, most stuff should adapt automatically, with one exception: CONTROL's draw event has a line running d3d_set_projection_ext. One of the arguments here is the aspect ratio (specifically the "1.76" near the end - it's the "aspect" argument in the argument listing), you should change this according to the aspect ratio you're using: for 4:3 it's 1.333 (4 divided by 3), for a square window (1:1 aspect ratio) it's 1, and so on.

"D3D models" as in models exported by GM or as in 3D models in general? I've seen a lot of OBJ loader scripts on the forums over the years so I never saw a need to make one myself, and plenty of video tutorials going over it as well:

thank you a lot for your answers!! all works fully well now :)

no, i am not talking about importing itself (didn't write the question fully before getting your agreement to help me more, because i've already wrote a lot of questions), but about integrating them in the game. in fact, the only question is about collision. if I have imported eg. a pyramid, how to make an object solid (i.e. so the player would go through), when it has not a just-a-box shape?

one of the possible crutchy solutions would be check if player is touching the object and grow players z until it stops touching it. shitty one, but i will be happy even with it, if you could game me an idea, how to check a collision between d3d-object and the player.

(1 edit) (+1)

There's a system for more advanced collision check functions, it's used by the different ramp objects: the zcheck_script_bottom and zcheck_script_top variables. These are called with two arguments, the x and y position we're doing a collision check over, and should return the top/bottom Z value of the object at that point.

Pyramids are actually a pretty complicated shape (4 triangular regions with different slope) but I think the easiest way is to check the x and y position difference vs the centerpoint of the pyramid - e.g. if the x difference is larger than the y difference AND the point you check has a higher x value than the center of the pyramid, you're on the right-hand quadrant, so you'd lerp from the top Z value of the pyramid to the bottom Z value of the pyramid using the x difference divided by half the sprite_width of the pyramid object. (The left hand quadrant does the same calculation but mirrors the x difference, and the top and bottom uses the y difference and the sprite_height instead)

So, how do i actually put things like wall objects on top of each other? I tried just putting one on another layer, but that doesn't seem to work (i'm on the latest version of gms 2)

(2 edits) (+1)

Check the creation code of the room and you'll find this bit, this is what arranges the objects in 3D space:


The idea is that the level is arranged in chunks 640 pixels wide (for this room in particular - you can use whichever value you want here), every subsequent chunk is put on top of the previous one.


There's a handful of backgrounds for different grid sizes which can be used to help judging distance, the one used in this room is 640 pixels wide. (I've tried an approach where multiple floors are on different layers for a different project but IMO it's an even worse experience since there's no depth perception)

If you're really sure you wanna do this with layers instead, you could try changing the lines in terrain_flat_to_3d from

z = 64*(x div global.level_chunk_width)
x =     x mod global.level_chunk_width

into

z = 64*(depth div 100)

so the depth value (which is obtained from the layers by default) is used instead. (In this case you probably want to start from a fresh room - by default layers have their depths spaced 100 units apart but the layers in the dungeon_test rooms use compatibility values)

(2 edits)

Hey, I tried using the code you mentioned, and for some reason it results in anything i place higher than the first layer actually being LOWER

i made a new room and put in the CONTROL object and a floor and a couple of walls on the first instances layer, then made a new one on top with a few walls, and for some reason all those walls are actually lower than the things on the bottom layer

this even seems to happen even if everything is on the same layer, with the walls always being below where they should be for some reason (just to a lesser extent)

(1 edit)

I messed around a bit and got very weird results, after a while I think I figured it out. There's some legacy shenanigans going on with the depth values, so you need to explicitly read them from the layers. This version of the code seems to work as intended:

z = -64*(layer_get_depth(layer) div 100)

But you also need to do two more things:

  • CONTROL currently changes its depth value in the create event, cut this line and paste it in the Room Start event (otherwise it gets an extreme depth value which in turn messes up where the player spawns on the Z axis)
  • Likewise, all of the "floor" objects sets their depth to 0 in the create event, remove this entirely.

The question is this - can I buy an engine, develop a game based on it, and sell it in styme, of course, indicating in the credits data about the engine?

Yes. Even indicating in the credits is optional.

(Note that this is a GameMaker: Studio source file so you may need a license for that to create a standalone game, depending on target platform)

In the License Agreement you state:

 "Games can be played but not resold, reposted or such. Assets can be used to create games, books, movies and such, but cannot be distributed in editable form." 

 What does that mean? By "Games" do you mean this engine?

Only asking because how I read it and interpreted it was that I can't sell/distribute my game if I get the engine and make one.

Let's say I make a game and change every aspect becides the FPS camera, can I sell/distibute said game?

(+1)

I'm using the same EULA for games and assets for convenience since a lot of the content would be the same. The line you're referring to is for my games ("Games" in the EULA), it doesn't apply to engines and other asset packs ("Assets" in the EULA).

The only thing I'm asking for this engine is, don't let other people (outside of your team) have the source code, only compiled game executables. So making a game with this engine and distributing that is totally OK. Uploading a copy of say, Dracula's Tower to Steam and claiming you made it is not OK.

(+1)

Gotcha, thanks for the clarification! I have the engine bookmarked for when I'm up for the FPS challenge. (Best GMS FPS Engine that I have found)

Hey, do you have a Discord server where I can ask for help with the engine? A friend and I wanted to make a Doomlike game, but I have no idea where to start with this.

My first idea would be to either fix the reloading system or remove it entirely

I don't; I prefer questions (and more importantly, answers) being somewhere they're publicly accessible, so they can help more than one person.

I'm not sure if I can wholeheartedly recommend this engine for new projects anymore since it just barely survived the GMS1-->GMS2 transition (it's originally made in GM6, so this is the third layer of compatibility functions...) and Yoyo have hinted at new 3D tech being on the roadmap, it might be completely obsolete in the near future. Depends a bit on project scope, of course.

Really? Didn't know they were teasing 3D. Where can I see this?
Oh well, I can always just use the 1.4 version.

If you check the "Announcements" channel on the official forums, there's the new "2D-3D" tool (used to make prerendered sprites in the style of Donkey Kong Country). Yoyo hired one of the more prolific 3D creators as a staff member and have hinted at more cool stuff happening, but it's all very vague so far.

Hey man, I made a game with this engine. CHECK IT OUT!!!!

(+1)

Oh wow, I expected people to use this engine for simple Doom clones and you went ahead and made a fantasy immersive sim?? Nice job!

(+1)

Thanks! Your framework has been a MASSIVE help to me over the past two years I've been developing Saccharine Pale! It will ALWAYS be free for you!

honestly at this point its essentially a completely different engine, other than the layered level editor lol

I want the torch to be active closer to the player. where can i find the code?

CONTROL object's Step Event:

I have the latest gamemaker S2. but my game can't go fullscreen. i have "fullscreen" mode on and "Allow fullscreen switching" why is this?

it worked with "window_set_fullscreen(true);"

Did you have "allow the player to resize the window" turned off, perhaps? (It wins out over all other window options)

hey, for some reason movement control not working at all on mac (gms 2.3.2), any ideas what can help?

Which movement control is not working? Mouse to control the camera or WASD to walk?

There's two different functions to alter the mouse position, window_mouse_set and display_mouse_set. The manual doesn't make it clear if there's any difference between them (e.g. platform support) but it points out that the game needs to have focus for them to work... I wonder if that's detected differently on Mac perhaps?

To detect movement keys (WASD) when the game doesn't have focus it could be worth trying keyboard_check_direct instead of keyboard_check, it works even when the window doesn't have focus.

 Can i use this for commercial projects?

Yes, of course!

Viewing most recent comments 1 to 12 of 32 · Next page · Last page