Jump to content

  • Log In with Google      Sign In   
  • Create Account


Norman Barrows

Member Since 04 Apr 2012
Online Last Active Today, 05:42 PM

Topics I've Started

comdat folding

14 September 2014 - 05:02 PM

Just for fun, i kicked the warning level up from 4 to all on the caveman project. it did catch a few explicit conversions i missed.

 

after suppressing the "#ifdef symbol is undefined" and "padding data structure" warnings in the windows and directx headers, and the "inlining" and "not inlining" warnings from the linker, i set linker output to verbose. then i tried all the different verbose setttings. when i tried - show comdat folding, this is what i got:

 

1>------ Rebuild All started: Project: caveman, Configuration: Release Win32 ------
1>cl : Command line warning D9025: overriding '/sdl-' with '/GS-'
1>  modeler.cpp
1>  Z3D.cpp
1>  Zaudio.cpp
1>  caveman.cpp
1>  Generating code
1>  Finished generating code
1>  
1>      Selected symbol:
1>          "public: __thiscall Zdrawinfo::Zdrawinfo(void)" (??0Zdrawinfo@@QAE@XZ) from modeler.obj
1>      Replaced symbol(s):
1>          "public: __thiscall drawrec::drawrec(void)" (??0drawrec@@QAE@XZ) from Z3D.obj
1>          "public: __thiscall ttyperec::ttyperec(void)" (??0ttyperec@@QAE@XZ) from Z3D.obj
1>          "public: __thiscall objtyperec::objtyperec(void)" (??0objtyperec@@QAE@XZ) from caveman.obj
1>          "public: __thiscall plantrec::plantrec(void)" (??0plantrec@@QAE@XZ) from caveman.obj
1>          "public: __thiscall chunk2::chunk2(void)" (??0chunk2@@QAE@XZ) from caveman.obj
1>  
1>      Selected symbol:
1>          "void __fastcall remove_stuff_near_cave(int,int,int)" (?remove_stuff_near_cave@@YIXHHH@Z) from caveman.obj
1>      Replaced symbol(s):
1>          "void __fastcall remove_stuff_near_rockshelter(int,int,int)" (?remove_stuff_near_rockshelter@@YIXHHH@Z) from caveman.obj
1>  
1>      Selected symbol:
1>          "void __fastcall runstate_cornered(int)" (?runstate_cornered@@YIXH@Z) from caveman.obj
1>      Replaced symbol(s):
1>          "void __fastcall run_defend_location_attack(int)" (?run_defend_location_attack@@YIXH@Z) from caveman.obj
1>  
1>      Selected symbol:
1>          "void __fastcall generate_CB2(int,int,int,int)" (?generate_CB2@@YIXHHHH@Z) from caveman.obj
1>      Replaced symbol(s):
1>          "void __fastcall generate_non_tropical_savanna_tree(int,int,int,int)" (?generate_non_tropical_savanna_tree@@YIXHHHH@Z) from caveman.obj
1>  
1>      ICF total savings: 774 bytes
1>  
1>  caveman.vcxproj -> C:\Rockland\caveman\Release\caveman.exe
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========
 

 

 

 

 

so this means that, for example, remove_stuff_near_rockshelter and remove_stuff_near_cave are identical at the object code and/or machine code level?

 

i understand the concept of how this could be, just want to confirm i'm reading this output correctly.

 

 

and:

1>      Selected symbol:
1>          "public: __thiscall Zdrawinfo::Zdrawinfo(void)" (??0Zdrawinfo@@QAE@XZ) from modeler.obj
1>      Replaced symbol(s):
1>          "public: __thiscall drawrec::drawrec(void)" (??0drawrec@@QAE@XZ) from Z3D.obj
 

means that internally the compiler is creating code that returns a pointer to a struct, and is using the same code for all? (all the symbols listed in this case are POD structs).

 

is it folding them because the structs just happen to be the same size, perhaps?

 

 

 

 

 

 

 

 

 


what's this error message mean?

27 August 2014 - 09:29 AM

a beta tester for caveman 3.0 is getting the following error message at startup:

 

"When I launch caveman.exe, I just get the windows error that it's stopped

working with the following details:

Problem signature:
  Problem Event Name: BEX
  Application Name: caveman.exe
  Application Version: 0.0.0.0
  Application Timestamp: 53cd7824
  Fault Module Name: StackHash_4c4a
  Fault Module Version: 0.0.0.0
  Fault Module Timestamp: 00000000
  Exception Offset: 00000016
  Exception Code: c0000005
  Exception Data: 00000008
  OS Version: 6.1.7601.2.1.0.768.3
  Locale ID: 1033
  Additional Information 1: 4c4a
  Additional Information 2: 4c4ad7529a34983b6293625c48169922
  Additional Information 3: 4c4a
  Additional Information 4: 4c4ad7529a34983b6293625c48169922


Then, immediately after choosing "close the program", I get the same error
again, with these details:

Problem signature:
  Problem Event Name: BEX
  Application Name: caveman.exe
  Application Version: 0.0.0.0
  Application Timestamp: 53cd7824
  Fault Module Name: StackHash_2264
  Fault Module Version: 0.0.0.0
  Fault Module Timestamp: 00000000
  Exception Offset: 00000500
  Exception Code: c0000005
  Exception Data: 00000008
  OS Version: 6.1.7601.2.1.0.768.3
  Locale ID: 1033
  Additional Information 1: 2264
  Additional Information 2: 2264db07e74365624c50317d7b856ae9
  Additional Information 3: 875f
  Additional Information 4: 875fa2ef9d2bdca96466e8af55d1ae6e

 

 

 

Any idea how i can look up what this means?

 

It happens right at startup.

 

the code does a call to getsystemtime, then creates a window class, then creates a window, then creates a d3dobject, then it enumerates the 32bit ARGB resolutions supported by the default adapter, and selects the highest based on width, then height. but it doesn't check for the accompanying required depth stencil buffer format support.

 

there are windows message box error messages.displayed if create window class, create window, or create d3dobject fail. but the user doesn't even see these. so i'm thinking its something more fundamental, like insufficient ram or vidram, or unsupported depth stencil buffer format.

 

any ideas?

 


Realistic PC movement in 1pv/3pv games

12 June 2014 - 12:38 PM

Realistic PC movement in 1pv/3pv games

 

its time for me to make some improvements to the basic movement code in Caveman 3.0:

http://www.gamedev.net/blog/1730/entry-2258672-caveman-v30-general-desciption/

 

given:

 

8 directions of movement (forward, back, left, right, and diagonals),

 

3 movement speeds (walk, run, sprint),

 

and 2 movement modes (normal and stealth mode),

 

what combos of the above are realistic?

 

note:  left means sidestep left, right means sidestep right, back means walk / run / sprint backwards.

 

the actual speeds of walk, run, and sprint would be modified by things like fatigue, encumbrance, damage, slowing effects, etc.

 

while you can side step, its not as fast as walking forward. you can side step fast - about as fast as walking forward - but trying to sidestep even faster usually results in tripping. same idea for walking/jogging/running backwards (try it!  but be careful!).

 

 

for non-stealth movement, i'm thinking:

 

* you can walk, run, or sprint forward.

* you can sidestep left and right or walk backwards at 1/2 your forward movement speed, but no sprinting.

* forward diagonal speed should be 3/4 of forward speed, and you can sprint.

* backward diagonal speed is 1/2 of normal speed, and you cant sprint.

 

i'm thinking that for stealth mode, you should only be able to move at 1/2 speed forward, 3/8 speed forward diagonal, and 1/4 speed in all other directions, no sprinting.  

 

once all this is determined, then the slope of the ground in the direction of movement would be applied to speed up or slow down the PC some.

 

I already do this, but based on the slope ahead, not in the direction of movement. 

 

modeling the players horizontal velocity and applying accel/decel for slope, movement, and drag/inertia would work even better. then you'd need some time to come to a stop when running down a big hill.

 

right now, i simply apply both left/right and forward/back movements, resulting in unrealistically fast diagonal speeds. fixing that, and speed based on slope in direction of travel, not direction of view, is what prompted me to update the movement code. so i figured that while i'm at it i ought to try to get it a realistic as possible.

 

so what seems most realistic?

 

 

 

 

 

 

 

 

 


Call for opinions: handling player death in a tutorial

01 May 2014 - 06:03 PM

Call for opinions: handling player death in a tutorial.

 

gametype: fps/rpg/person sim.

 

but the question could apply to many types of games: fps, side scroller, arcade, rts, etc.

 

so, how to handle player death in the tutorial?

 

autosave points? 

 

remove badguys and continue where they died?

 

start tutorial over?

 

 

 

 

 

 


multiple resolutions, multiple monitor aspect ratios, and non-square pixels

25 April 2014 - 12:43 PM

multiple resolutions, multiple monitor aspect ratios, and non-square pixels

 

i'm adding support for different resolutions to my current project.

 

this means i've been playing with the parameters for the projection matrix (width, height, fov, aspect ratio).

 

width and height will depend on the resolution chosen (automatically or by the user).

 

i played around with fov and aspect ratio, then set them back to the original values of 45 degrees and 16:9.

 

but how do i deal with monitors whose physical aspect ratio differs from that of the current resolution?

 

locking the projection aspect ratio at 16:9 vs width/height fixed stretching of the 3d scene when going from 1600x900 to 1024x768

 

i'm using device independent versions of blit, getmouse, and putmouse. fonts use blit, so they got a free ride.

 

so everything has ported nicely, in just a day. thank god for global search and replace.

 

but while playing with the projection matrix, i got back into trying to make it more like human vision. as a result i started experimenting with letterboxing the scene to a 3:1 or 2:1 aspect ratio.

 

this is when i hit the problem of monitor aspect ratio vs resolution aspect ratio. whent hey're not the same, pixels aren't sqaure. and it makes it hard to letterbox to an aperature that is twice as wide as it is tall. the aspect ratio of the monitor is required.

 

widescreen monitors are a related issue.

 

any good way to deal with all this to get the same thing on all monitors at all resolutions?

 

i've been working at 1600x900 on a monitor with (apparently) square pixels, but am now adding support for other resolutions. 

 

from searches here, it appears that getting the actual correct monitor aspect ratio is somewhat hit or miss, with a registry inquiry the most likely to succeed (but perhaps still not guaranteed correct?). and "pick a size" on a graphics settings menu is a typical approach. with options like 4:3, 16:9, 5:4, 16:10, etc

 

once i have both the monitor and resolution aspect ratios, i should be able create a letterbox aperature whose height is half its width on any monitor at any resolution. 

 

 

another approach is "why bother?" and i may end up settling for that. but i'm not really interested in such responses, so please don't waste you time.


PARTNERS