Programming Thread

Started by the-pi-guy, Mar 13, 2016, 10:39 PM

previous topic - next topic

0 Members and 2 Guests are viewing this topic.

Go Down

Legend

Is there a quick and dirty way to do collision detection based off one location and the next one?
Only for spheres or aligned cubes.

Or is this 2d?

the-pi-guy

May 14, 2019, 08:44 PM Last Edit: May 14, 2019, 08:50 PM by the-pi-guy
Only for spheres or aligned cubes.

Or is this 2d?
3D, mostly cubes.  

I came up with a quick and dirty method.  :P

Not something that I'd use for a real game, but for a homework assignment that I haven't spent much time on, I think it'll be okay.  

Just going to make a bubble around each game object, and return true if two objects are sufficiently close.  

the-pi-guy

May 14, 2019, 11:02 PM Last Edit: May 15, 2019, 02:10 AM by the-pi-guy
I am making a zombie horde mode.  :P

I'm having a lot of fun, actually.... 


Need to dos:
-Add lighting source
-make new ground
-make better projectiles
-add score
-make zombies appear

-give zombies AI
-other stuff I haven't thought of yet.

Legend

Don't forget sound effects and music!

I want you to find a mic and say "brains" over and over.

the-pi-guy

Don't forget sound effects and music!

I want you to find a mic and say "brains" over and over.
Sound effects is low priority.  :P

This is a lot of fun.   A lot of small victories.  A few big victories. 

Oddly enough adding text was one of the harder things. Because webgl doesn't have a way to add text.  So you have to add another canvas to place on top of the main canvas that is clear.  And then add text to that using a different context. 

While my zombies are rectangular prism shaped, I still feel proud of this. 

the-pi-guy

Ugh, I'm gonna turn it in late.  

My game doesn't require a lot of stuff that's required for the assignment. The game itself is like 80% done, it only has like 20% of the list.  

So I have to figure out some stuff to add...

the-pi-guy

I had a fun little bug this morning.

Was playing the game and I noticed that the collision detection only worked once.   So I was making sure the wait variable was getting assigned correctly.  Everything seemed correct. 

Turned out I had two bugs. 

The first was that the villain would get thrown upwards (as intended) but they stayed there. 

How did not notice? 
In with the second bug the "villains" were not getting drawn properly.  The modelview matrix not take into account the height of the villain. 

So the zombie was in the air, but still being drawn on the ground.

Thought it was fun how two bugs worked together so well to look like a bug somewhere else. 

Legend

Looking for advice/feedback.

For my RPG, the final look of the game is a 2D fantasy map. I'm not sure how I can render this.

Essentially it's like Google maps where the camera can show the whole world or zoom in close to the player.

65,536×65,536 pixels for the whole map.

I think what I need to do is create a render function that can replace texture streaming. Give it an x,y position and a zoom factor and it'll produce that texture.

2048x2048 texture for around the camera. 1024x1024 texture at quarter res for around that, 512x512 texture at 1/16 res around that. first texture has a backup texture for rendering into.

Or I could do a sparce quad tree. Render into a 2048x2048 buffer and populate the quadtree from that. Sounds better since data wouldn't overlap and merging quads as they get away from the camera would be cheap. Downside is that I'd need a custom shader to draw this quadtree on screen. Could be too slow for VR.

the-pi-guy

Looking for advice/feedback.

For my RPG, the final look of the game is a 2D fantasy map. I'm not sure how I can render this.

Essentially it's like Google maps where the camera can show the whole world or zoom in close to the player.

65,536×65,536 pixels for the whole map.

I think what I need to do is create a render function that can replace texture streaming. Give it an x,y position and a zoom factor and it'll produce that texture.

2048x2048 texture for around the camera. 1024x1024 texture at quarter res for around that, 512x512 texture at 1/16 res around that. first texture has a backup texture for rendering into.

Or I could do a sparce quad tree. Render into a 2048x2048 buffer and populate the quadtree from that. Sounds better since data wouldn't overlap and merging quads as they get away from the camera would be cheap. Downside is that I'd need a custom shader to draw this quadtree on screen. Could be too slow for VR.
Have you looked at how that's usually implemented?  Is there some limitation with those that you are trying to avoid?  

Legend

Have you looked at how that's usually implemented?  Is there some limitation with those that you are trying to avoid?  

I can't save the full image so I need to re render a lot of times.

the-pi-guy


the-pi-guy

I can't save the full image so I need to re render a lot of times.
Sorry, I don't think I can help.

the-pi-guy

So I would like to make a math program sometime, basically allowing:

-user text to input equations with the usual operations
-user to save functions
-user to save variables
-degrees/radians
-other bases

Must haves:
-cos, sec + inverses
-sin, csc + inverses
-tan, cot + inverses
-lg
-log
-ln
-logx
-The usual operations:  ^, *, /, +, -, !, |, &, =, !=, <, >, <=,>=, %
-Maybe a special operation to allow mixed bases
-(, )
-(mod x)

User will set variables or functions using set keyword:
User: set x = 5
User: x
System: 5

User set f(x) = 2*x
User: f(x)
System: 2*x

User: f(3)
System:  6

Nice to haves:  (Will probably get too bored to do these:)
-matrix features
-a more robust editor
-list features {2,3,4} * 5 = {10, 15, 20}
-other fancy features: special functions like prime counting function, function to return if p is prime

the-pi-guy

May 21, 2019, 01:31 PM Last Edit: May 23, 2019, 02:38 AM by the-pi-guy
In progress:

set_func-> set id( args ) = statements

any_exp -> bool_exp | set_exp | mod_exp
bool_exp -> (bool_exp bool_op bool_exp) | exp op exp | true | false | null
set_exp -> SET id = any_exp
mod_exp -> exp (MOD exp)

exp -> exp + factor | exp - factor
factor -> factor * fact | factor / fact | factor % fact
fact -> fac ^ fact
fac -> term !
term -> (exp) | real | id | id( in_args )

op -> = | != | >= | <= |  < | >
bool_op -> || &

statements -> while bool_exp { statements }
statements -> if bool_exp { statements } (else{ statements })?
statements -> set_exp;
statements -> return exp;
statements -> print exp;


----------------------

PRINT
RETURN
SET
IF
WHILE
LPAREN
RPAREN
LBRACK
RBRACK
LSQ
RSQ
EXP
ADD
SUB
DIV
MUL
FACTORIAL
OR
AND
EQUAL
NEQUAL
GT
LT
GEQ
LEQ
MOD
REMAIN
REAL = (0-9)*.?(0-9)*
ID = (A-Z | a-z) (A-Z | a-z | 0-9 | _)*

the-pi-guy

May 23, 2019, 02:38 AM Last Edit: May 23, 2019, 02:49 AM by the-pi-guy
I think I have everything.

Think the grammar does what I want it to do, and I think it has all the features that I want it to have.  

-Decent at Java
-Learning C++
-Probably doesn't count, but "TI-BASIC" it's for calculators.  :P
C, Java, C++, Python, MIPS assembly, TI-BASIC, JavaScript, learned enough Erlang in a day to do an assignment.  

Look how far I've come.

Go Up