Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - d3x0r

Pages: 1 ... 3 4 [5]
61
Programming with Blackvoxel / Re: What things are already available?
« on: October 18, 2014, 05:20:35 am »
So overlapping textures is a known issue :)  The fire texture did the same thing...

62
Programming with Blackvoxel / What things are already available?
« on: October 18, 2014, 01:12:48 am »
Do you have something like 'the voxel in-line with the screen pos at a certain distance' sort of thing?  I found the add a block on right click, and extended it to do something silly like make a cluster of blocks in a relative direction... So it's pretty easy to set voxels in the world.

Is there something about the order to set voxels in so transparent textures work better?  When I used fiber optic, repeated, complex stepping had transparency issues, that the textures further back were rendered over the visible fronts...

Something like in space engineers, when you create a new ship, your first focus is at a fixed distance from you along the mouse ray.
-----
THe other feature I was thinking I'd like would be, the block next to an existing type of block that the mouse ray is passing through... I realize that if you were looking down a wall that many voxels in line would be valid... so again maybe at a distance from the cursor... use like ctrl or alt-scroll wheel to set the distance?  Maybe I don't want that... maybe I can just click on a point to begin pathing.... well see still need to know which side near that block the mouseray is going through...

Like if I start with a center block in space (give the player a zero-g jetpack something) was going to use a center block with 6 blocks around it also filled in as a base shape for a neuron, and use the 6 voxels around it as connecting points... then still in that place, to extend a line outwards from there; in space engineers creative you cyou can hold ctrl and when building it selects a line of blocks... it's only a valid line when the mouse ray passes through a block on that line... so in theory there's 6 lines that extend out from this central shape, that I want to extend out away from myself, so i can't see the face to add the block to...

63
Programming with Blackvoxel / Re: Stair building script
« on: October 18, 2014, 01:05:24 am »
(didn't mean to reply)

64
General Discussion / Re: SDL2 and how to close gui's?
« on: October 17, 2014, 04:44:23 am »

Break out SaveWorld from End_PhysicsEngine()....

Code: [Select]
void ZGame::SaveWorld(  )
{
  ZStream_SpecialRamStream Stream;
  ZStream_File FileStream;
  ZString FileName;
  if (COMPILEOPTION_USEHOMEDIRSTORAGE)
  {
    FileName = ZStream_File::Get_Directory_UserData();
    FileName.AddToPath(COMPILEOPTION_SAVEFOLDERNAME);
  }
  FileName.AddToPath("Universes").AddToPath((ZString)UniverseNum).AddToPath("PlayerInfo.dat");
  FileStream.SetFileName(FileName.String);
  if (FileStream.OpenWrite())
  {
    Stream.SetStream(&FileStream);

    PhysicEngine->GetSelectedActor()->Save(&Stream);
    Stream.FlushBuffer();
    Stream.Close();
    FileStream.Close();
  }
/*
  // Inventory Saving
  char Buffer[1024];
  sprintf(Buffer, "%s/%ld/PlayerInfo.dat", UniverseNum);
  PhysicEngine->GetSelectedActor()->Inventory->Save(Buffer);
*/

}

bool ZGame::End_PhysicEngine()
{

  // Save Physic engine actors

#if COMPILEOPTION_ALLOWSAVEPLAYERSTATE == 1
  SaveWorld( );
#endif


  if (PhysicEngine) delete PhysicEngine;
  PhysicEngine = 0;
  Initialized_PhysicEngine = false;
  return(true);
}

add save world key F6...
Code: [Select]
case SDLK_F6 & 0xFF:
GameEnv->GameWindow_Advertising->Advertise("Saving....", ZGameWindow_Advertising::VISIBILITY_HIGH,0,1000,500);
GameEnv->SaveWorld( );
break;

disable auto save :)

65
General Discussion / Re: SDL2 and how to close gui's?
« on: October 16, 2014, 08:47:48 pm »
I also threw together a cmake build script for the project since the make system was simple enough.
Need an option to set things like

Code: [Select]
OPTION( COMPILEOPTION_ALLOWSAVEPLAYERSTATE "Allow Save Player State" ON )

Oh I see; I should have traced that back to its actual defintiion; assumed it was just undefined....

:) DEVELOPPEMENT_ON :) is spelled wrong
I guess the option should be more like

Code: [Select]
OPTION( DEVELOPPEMENT_FORCE_DEV "Build dev mode (disable save)" OFF )
OPTION( COMPILEOPTION_DEMO "Build demo mode (enable save)" ON )

or something....

66
General Discussion / Re: Newbie Guide?
« on: October 16, 2014, 08:53:44 am »
How deep is Blackrock Green? How do I find it?
it's like 64-75 down... and another 64 down is orange.


67
General Discussion / What I want to do....
« on: October 16, 2014, 04:17:43 am »
Hi;
I have ...


On the left is a piece and a via connection thing, so you put down a block, and connect to it.
I want to work on a 3d version of the via(path) logic .

I'm going to allow diagonal block selection, with the assumption that I can patch in a diagonal block shape for filled edges... like I do with a 2d cell sort of thing...

like .. page 19 of this....

I'm pretty sure I can just hook my dialogs in... or make a alternate OnRender path and share a space.... probably remove SDL video; sdl sound seems OK other than it's not easy to just pass end of stream when no sounds... so it's always processing.  I used OpenAL with ffmpeg library....

----------
and text labels over process blocks; maybe indicating how much carbon I fed it... it was not clear that many carbon followed by a metal uses all carbon, but it doesn't... it's like there was carbon left in the furnace.

You have a very large system of available processes; and the default theme appeals to me :)

(Dystopia game screenshot of matrix.)

68
General Discussion / Re: SDL2 and how to close gui's?
« on: October 16, 2014, 03:56:09 am »
I key; great :)

-----
(SDL2 changes; SDL_CreateThread takes a name now (of the thread proc itself, instead of "thread_proc" maybe)
---------
My games aren't saving.
my last world2 I died, and saved hit escape and got out before being respawned.  Now I get console messags that say 'fatal fall...' something but don't die.   And when I move a couple steps and quit, it always starts where it was, including old worlds... hmm the binary download saves... wonder what I broke.


69
General Discussion / SDL2 and how to close gui's?
« on: October 15, 2014, 11:59:30 pm »
So I found the keys that generate mouse buttons (like scroll wheel) and I guess middle click is how to activate the user block cube; but the only way I found to close that is to hit escape which is save and exit...  can escape be pre-empted by gui screens to close?

SDL2... I grabbed this, only took them 10 years to come out with it :)  Not a lot changes... have to change the type of 'GameEnv::screen' and use a different function to open the window; and unfortunatly the display info stuff is different, ended up just chopping that out for a fixed value from the settings file.... the swap call takes the GameEnv->screen(window) variable...

Code: [Select]
#define SDL_GL_SwapBuffers()             SDL_GL_SwapWindow( GameEnv->screen )

/* .... in ZGame... */
#ifdef SDL1
  SDL_Surface * screen;
#else
  SDL_Window * screen;
#endif


The sound system is different I guess; the last buffer is never cleared,
at the end of ZSound::MixAudio....

Code: [Select]
  if (nSounds) for (i = 0; i < Buffer_Len / 2; i++) ((Short *)stream)[i] = (Short)(SoundBuffer[i]);
  else
  memset(stream, 0, len);
otherwise stream is not cleared when there were no sounds to mix, and that block keeps looping.

---------
removed a lot of references to including SDL, since it's included in ZGame.h anyway and seems most everything ends up including that.
----------

how do I exit a gui dialog?   is it easy to add a X button?

----------
The method for the mouse is different; but a simple define can fix that

Code: [Select]
#define SDL_WM_GrabInput      SDL_SetRelativeMouseMode
#define SDL_GRAB_ON          SDL_TRUE
#define SDL_GRAB_OFF           SDL_FALSE

// otherwise warp mouse takes the window/screen as parameter
#define SDL_WarpMouse SDL_WarpMouseGlobal

----------
Some missing/modified keyboard handling/mapping.  Have to take the sym & 0xFF a lot of places because they set a high-bit in it (1<<30)

Code: [Select]
#define SDLK_KP0 SDLK_KP_0
#define SDLK_KP1 SDLK_KP_1
#define SDLK_KP2 SDLK_KP_2
#define SDLK_KP3 SDLK_KP_3
#define SDLK_KP4 SDLK_KP_4
#define SDLK_KP5 SDLK_KP_5
#define SDLK_KP6 SDLK_KP_6
#define SDLK_KP7 SDLK_KP_7
#define SDLK_KP8 SDLK_KP_8
#define SDLK_KP9 SDLK_KP_9

---------------
SDL2 also changes how the scroll wheel is handled, instead of passing it as a button it's an axis, and they support horizontal/vertical scroll...  so my scroll wheel is broken for changing items, but I found the keys for now.

Pages: 1 ... 3 4 [5]