QB64.org Forum

Active Forums => QB64 Discussion => Topic started by: MasterGy on May 03, 2020, 04:14:58 pm

Title: I'm looking for helpers to make a joint game
Post by: MasterGy on May 03, 2020, 04:14:58 pm
Hi!

I started a game. I realized that despite the energy invested in the track, once someone goes through it and it gets boring. Because it can't be so perfect here

track, and unnecessary. Be varied and enjoyable and always get the player new!

I figured out that different algorithms would create the orbit.

Eg 1 house should not be just 1 house, but the program should put together a house based on expectations. So we can't go into the same house twice.
And everything should be completely random.

I also have an idea for the strategy of the game. Obviously 1 can only be, but its circumference can be varied.

I would like to ask for ideas, tb ...

If anyone would send me low-poly items, I would be very happy.
Or he would edit me in a projection diagram anything that is based on the syntax he likes best.

I think it would be great to have a joint game, anyone who is willing to participate is looking forward to it.
So far I have made such a RANDOM track generator, wasd + mouse, SPACE-new track generation.

https://drive.google.com/open?id=19eF_JEIVwvyIyy_RDHdi-fUvAlW8XCB8 (https://drive.google.com/open?id=19eF_JEIVwvyIyy_RDHdi-fUvAlW8XCB8)

  [ This attachment cannot be displayed inline in 'Print Page' view ]  



Title: Re: I'm looking for helpers to make a joint game
Post by: granzeier on May 04, 2020, 09:09:34 am
Not specifically related to your game, but the December 1980 issue of Byte (https://ia802602.us.archive.org/28/items/byte-magazine-1980-12/1980_12_BYTE_05-12_Adventure.pdf, page 186 - PDF page 188) had an article on "Character Variation in Role-Playing Games". Many of the ideas presented in the article can apply to rooms, and other inanimate objects, as well as characters.

There are also many other articles on game-playing in that issue. It's one of my favorite issues.
Title: Re: I'm looking for helpers to make a joint game
Post by: SpriggsySpriggs on May 05, 2020, 10:12:41 am
Wow! That looks very well done! I wish I knew enough about graphics to get involved with that!
Title: Re: I'm looking for helpers to make a joint game
Post by: 40wattstudio on May 05, 2020, 11:41:22 am
If you're looking for help with low-poly objects you might want to try the Itch.io job board -- there are frequently people asking for and offering help in a variety of gamedev aspects.
Title: Re: I'm looking for helpers to make a joint game
Post by: Unseen Machine on May 05, 2020, 01:30:25 pm
http://www.md2.sitters-electronics.nl/models.htm (http://www.md2.sitters-electronics.nl/models.htm)

To load/render em you can use GDK_GL if your using GL, if youre using hardware then i/you can modify the renderer to use _MAPTRIANGLE but it wont support rotations so youll have to figure that out.

Its a shame we dont have [abandoned, outdated and now likely malicious qb64 dot net website - don’t go there] cause many years ago DarthWho used Quarternions to do the rotations on my .MDL maptriangle model renderer...

Unseen
Title: Re: I'm looking for helpers to make a joint game
Post by: MasterGy on May 06, 2020, 10:55:21 am
Thanks for the comments!

I don't like 3d editors for this purpose because you include a lot of unnecessary points and polygons.
And here you have to be very careful that excess copper does not burden the whole thing.

I use a very simple method to create 3d shapes.
For example, the "philippines and the resisters" are enemies, born in a projection diagram, on paper.

I also checked out GDK_GL! very good !!! I like the light-shadow, and the fact that it only needs to be charged once and the rotation is arranged by him.
My only problem is that .x format this way, this way I can't write directly.
Later, I want my own solution that converts the data used by maptriange to .x format because I like its usability.

I'm staying with _maptriangle for now because it's easy to use.

If someone is in the mood, all you need is paper and pencil, and time ...

And then simple shapes: chair, table, garden swing, whatever ....

If anyone feels like it, I’ll be very happy to receive the numbers in plain txt. I will convert it to the appropriate format.
In fact, if you’re really interested in someone and want to be involved in the whole thing, I’ll write a viewer, just type the numbers from the paper in txt, and the program will show that

has it been good.

This could be a really common game!
Plenty of items could make the whole thing very high quality.

thank you!

  [ This attachment cannot be displayed inline in 'Print Page' view ]  

  [ This attachment cannot be displayed inline in 'Print Page' view ]  
Title: Re: I'm looking for helpers to make a joint game
Post by: Petr on May 06, 2020, 02:48:04 pm
Hi.
This is exactly the way I followed when creating a 3D room with a 3D maptriangle. Paper and pencil. I chose the center of the body wrong at that time, today I would choose 0,0,0. This is due to the rotation of the body around its center (if it is a symmetrical shape). Of course, it is also possible to calculate the asymmetric rotation along all axes. The easiest way to create a 3D solid is to make it 2D and then move two identical copies of the points in the Z axis behind each other. To greatly improve the ability to create a more detailed room (from multiple points), I used circular detection in the Z axis adjusted to a semicircle. Simply - calculates only what has a negative Z <-1, in a certain range. There are better methods that could be implanted subsequently, but I have not solved it. For loading objects, it is great if different textures can be used for the same series of points. Then, for example, different textures can be implanted on a desk model to achieve very easily different desks.

https://www.qb64.org/forum/index.php?topic=1504.msg107025#msg107025
https://www.qb64.org/forum/index.php?topic=300.msg109293#msg109293
https://www.qb64.org/forum/index.php?topic=300.msg102191#msg102191
Title: Re: I'm looking for helpers to make a joint game
Post by: MasterGy on May 10, 2020, 07:07:34 am
Hi !

I’m a little disappointed that no one wants to join in creating a common game program.

Indeed, it couldn’t provide a modern look, it would give a sense of about 90 ’FPS, but we could still be proud to have succeeded.

I’m on it if I’m alone, but I still do, max lasts longer.
I would need items. No one applied :(

I got to the point of space perception solution. I tried 3d-matrix (_BIT) first, but there was a lot of time for conversion and it was inaccurate.

Now you have the game, you can crawl, look around.

I need items. Not for links, but for your own ideas, results.

If you still don't care about anyone, I won't bother you.

https://drive.google.com/open?id=1pnpO12N_To0gND_m9vogbQ-01lQlek0d (https://drive.google.com/open?id=1pnpO12N_To0gND_m9vogbQ-01lQlek0d)

  [ This attachment cannot be displayed inline in 'Print Page' view ]  

Title: Re: I'm looking for helpers to make a joint game
Post by: MasterGy on May 10, 2020, 03:16:39 pm
Petr, I've tried the 3d editor .. I've been thinking about how to approach an editor in an easy way, I like your approach!

There are many rotations in the program. all elements are rectangular. I give not 8 points, but the center of 1 point (XYZ), and 2 angles, ends, and angles are randomized to introduce an irregularity.

After all, it is not a problem if a body is not specified centrally. You subtract half the width, then you get the middle, rotate, and then return.

It would be nice to have an editor that does low-polys easily, and that could be easily integrated into qb here. So far I have not found any solution.
Title: Re: I'm looking for helpers to make a joint game
Post by: MasterGy on May 15, 2020, 05:35:58 pm
I'll show you, the program creates a random track, and you can move around it, look for a way.
For now, the goal is to try to climb as high as possible on the structure




https://drive.google.com/file/d/1G_1kWh2MYQJ2oX6H_p51LGjfi34waFnV/view?usp=sharing (https://drive.google.com/file/d/1G_1kWh2MYQJ2oX6H_p51LGjfi34waFnV/view?usp=sharing)
Title: Re: I'm looking for helpers to make a joint game
Post by: Ashish on May 17, 2020, 11:37:46 am
I am amazed! Great job on your game engine!
You know, I am working on my 3D game and its game engine nothing in front of yours. :)
Title: Re: I'm looking for helpers to make a joint game
Post by: MasterGy on May 17, 2020, 12:13:35 pm
thanks !

When the engine is done, I want to expose it to see if it is used by others.
It's still good, you can move a fairly large area, but above the calculation of about 30,000 points it is already very slow. It’s under 30,000 in the video, so it’s good for that, that’s the limit. However, I want a larger area for 1 field.

I want to divide visibility into 3d Blocks and calculate with unity what is visible and what is not from a given point, and this would be stored in a 3d array.
The thing works, just so slowly that a data set the size of a video takes several hours to calculate. However, if I could somehow solve this, it would be much larger than the track I saw in the video, and all in all, that would be the point: count a little while displaying, don’t grab the machine.
Title: Re: I'm looking for helpers to make a joint game
Post by: Unseen Machine on May 17, 2020, 02:10:24 pm
Quote
It's still good, you can move a fairly large area, but above the calculation of about 30,000 points it is already very slow. It’s under 30,000 in the video, so it’s good for that, that’s the limit. However, I want a larger area for 1 field.

I want to divide visibility into 3d Blocks and calculate with unity what is visible and what is not from a given point, and this would be stored in a 3d array.

Thats why you should use OpenGL rather than _MAPTRIANGLE, You'd only have to render your enviroment once as a list (or more probally a list of lists ;) ) and then just call the list which would be embedded in memory. OpenGL would do the distance/rotation and visablity calculations for you so you would not need the array.

Either way you go i like what you've managed to acheive so kudos for that.

Happy coding,

Unseen
Title: Re: I'm looking for helpers to make a joint game
Post by: MasterGy on May 17, 2020, 03:10:28 pm
I will tell you honestly that I was still lazy in studying opengl.
I like all the possibilities that lie within it. light, speed.
But I don’t just want to display it as a model.

unfortunately I found no example that I could apply.
Since there will be moving objects, enemies on the field, so you have to recharge the whole thing every time?

thanks
Title: Re: I'm looking for helpers to make a joint game
Post by: Unseen Machine on May 17, 2020, 03:54:26 pm
Quote
Since there will be moving objects, enemies on the field, so you have to recharge the whole thing every time?

But they wont have anything to do with all the terrain and static models so all of those can be done in lists (which i think have been superseeded by vertex buffers in Gl ES2) either way it's not that hard to learn to be fair, especially for someoone who has quite obviously show they are no slouch when it comes to the coding!!!

Unseen

Title: Re: I'm looking for helpers to make a joint game
Post by: Ashish on May 18, 2020, 02:48:18 am
I will tell you honestly that I was still lazy in studying opengl.
I like all the possibilities that lie within it. light, speed.
But I don%u2019t just want to display it as a model.
OpenGL is very powerful if it used in right way.
Here is a short of video of the game engine I'm currently working -




PS : The video was recorded at 25FPS. But the actual program run at 60FPS
Title: Re: I'm looking for helpers to make a joint game
Post by: Unseen Machine on May 18, 2020, 03:23:43 am
@Ashish

WOW Bro! That looks great! Glad to finally see a few people actually pushing QB64! It's Wolf3d/Kens labyrinth style and as an 80's baby i can dig that! All i can think to add is maybe you should have a look at some bump mapping on your doors and walls to really make it pop.

Unseen
Title: Re: I'm looking for helpers to make a joint game
Post by: Unseen Machine on May 18, 2020, 05:50:56 am
I had a look in my dropbox and found my Wolf3D map editor/renderer! I wrote it in 2011 when we had to use SFML to use GL! I'm moving house today but i might have a little go at updating it over the next week or so!

Here's some pics, one with lighting effects enabled.

Unseen
Title: Re: I'm looking for helpers to make a joint game
Post by: MasterGy on May 18, 2020, 11:29:44 am
Congratulations Ashish for doing the 3d space with opengl!
Very good ! I wish I understood opengl so much!

I looked at the tutorial on your link! you write very nicely, understandably about the use of opengl 2d, colors, elements! (I suddenly had a lot :)

I searched in vain for an understandable description from the basics, in Hungarian, but I couldn't find it, so far your writing was the best!

I can't wait to continue! Show me what qb64 + opengl can do!

Good job if you’re expanding your 3d game, I’d love to watch a video of it the way it is  evolving!
Title: Re: I'm looking for helpers to make a joint game
Post by: MasterGy on May 18, 2020, 11:43:48 am
Very good Unseen Machine ! There was no shadow in Wolf3d under Dos yet, now you have brought the space to life!

would it be possible for doom, shadows warrior, blood (my favorite) to revive the tracks? to improve textures and bring them to life in beautiful quality.

If the story and the enemies couldn’t be programmed in the same way, but I think it would be worth it to have a nostalgia walk in it.
Title: Re: I'm looking for helpers to make a joint game
Post by: Ashish on May 18, 2020, 12:09:54 pm
Thanks @Unseen Machine. Looking forward to your 3d editor! :)
Thanks @MasterGy I am currently working on 2D transformation section.
So far, I added traps in my game engine. (like laser)
Title: Re: I'm looking for helpers to make a joint game
Post by: Galleon on May 21, 2020, 05:08:47 am
RE: OpenGL vs _MAPTRIANGLE: OpenGL is (obviously) more powerful. However, the way I have seen OpenGL used by people in QB64 is heavily reliant on the fixed OpenGL pipelines and lighting found in OpenGL 1 which was all deprecated in OpenGL 2. Mobile devices do not support OpenGL 1. If QB64 ever did support mobile devices that code will simply not work. _MAPTRIANGLE was written to be fully compatible with OpenGL 2+ so it would work.

RE: _MOUSEMOVEMENTX & _MOUSEMOVEMENTY: Very broken ATM which means you cannot make first person mouse navigated content in the latest versions of QB64.

If I wanted to implement lighting using _MAPTRIANGLE I might do something like this in the code by MasterGy.
This code was a quick hack just to see what was possible and it may have flaws but the underlying concept should be sound enough.
Note that if the triangles are too big (like the floor from the code provided) it will be dark because all corners are a long way away from the player. Breaking the floor into multiple triangles would fix this problem. Performing SQR math on each triangle vertex is computationally expensive and a lookup table of SQR results may improve performance.

Add this code to MasterGy's code to see how this concept works:
somewhere in the init phase...
Code: QB64: [Select]
  1. lightmap32 = _NEWIMAGE(512, 512, 32)
  2. _DEST lightmap32
  3. FOR x = 0 TO 512
  4.     FOR n = 0 TO 255
  5.         b = x / 2
  6.         h = b + n
  7.         IF h > 255 THEN h = 255
  8.         IF h < b THEN h = b
  9.         l = b - n
  10.         IF l < -255 THEN l = -255
  11.         IF l > b THEN l = b
  12.  
  13.  
  14.         IF b = 0 THEN b = 1
  15.         IF l = 0 THEN l = 1
  16.         IF h = 0 THEN h = 1
  17.  
  18.         IF n <> 0 THEN
  19.             PSET (x, 256 + n), _RGBA(0, 0, 0, h)
  20.             PSET (x, 256 - n), _RGBA(0, 0, 0, l)
  21.         ELSE
  22.             PSET (x, 256), _RGBA(0, 0, 0, b)
  23.         END IF
  24.     NEXT
  25. lightmap33 = _COPYIMAGE(lightmap32, 33)
  26.  

Change _MAPTRIANGLE (sx1, sy1)-(sx2, sy2)-(sx3, sy3), pictri(triangles(actual_triangle, 3)) TO(wx1, wy1, wz1)-(wx2, wy2, wz2)-(wx3, wy3, wz3), , _SMOOTH to...
Code: QB64: [Select]
  1.         _DEPTHBUFFER LOCK
  2.         _MAPTRIANGLE (sx1, sy1)-(sx2, sy2)-(sx3, sy3), pictri(triangles(actual_triangle, 3)) TO(wx1, wy1, wz1)-(wx2, wy2, wz2)-(wx3, wy3, wz3), , _SMOOTH
  3.         _DEPTHBUFFER ON
  4.  
  5.         d1 = SQR(wx1 * wx1 + wy1 * wy1 + wz1 * wz1)
  6.         d2 = SQR(wx2 * wx2 + wy2 * wy2 + wz2 * wz2)
  7.         d3 = SQR(wx3 * wx3 + wy3 * wy3 + wz3 * wz3)
  8.  
  9.         b1 = d1 / 3
  10.         IF b1 > 255 THEN b1 = 255
  11.         IF b1 < 0 THEN b1 = 0
  12.         b2 = d2 / 3
  13.         IF b2 > 255 THEN b2 = 255
  14.         IF b2 < 0 THEN b2 = 0
  15.  
  16.         b3 = d3 / 3
  17.         IF b3 > 255 THEN b3 = 255
  18.         IF b3 < 0 THEN b3 = 0
  19.  
  20.         b3 = b3 - ((b1 + b2) / 2) + 256
  21.  
  22.         b1 = b1 * 2
  23.         b2 = b2 * 2
  24.  
  25.         _MAPTRIANGLE (b1, 256)-(b2, 256)-((b1 + b2) / 2, b3), lightmap33 TO(wx1, wy1, wz1)-(wx2, wy2, wz2)-(wx3, wy3, wz3), , _SMOOTH
  26.  
Title: Re: I'm looking for helpers to make a joint game
Post by: MasterGy on May 21, 2020, 12:20:20 pm
Wooow, that's very interesting !! Thanks Galleon!
I am very glad that you drew my attention to this opportunity!
I haven’t known _DEPTHBUFFER so far, but as soon as I have time for it, I’ll study it.
Is this some kind of color-mixing mask that you project onto the texture?

It’s very interesting and an excellent idea to have a light effect.

Thanks !
Once this becomes a game, your name will be there!

So _MOUSEX therefore doesn't work on qb64 1.4? Um ... I did not know this!
Title: Re: I'm looking for helpers to make a joint game
Post by: Petr on May 21, 2020, 05:22:14 pm
Hi,

Galleon talk about _MOUSEMOVEMENTX, not about _MOUSEX.

This problem can be solved so:

Code: QB64: [Select]
  1. DIM SHARED OMX, OMY
  2. SCREEN _NEWIMAGE(800, 600, 32)
  3.  
  4.  
  5.  
  6.     GETMovement mmx, mmy
  7.     LOCATE 1
  8.     PRINT mmx, mmy
  9.     _PRINTSTRING (x, y), " "
  10.     x = x + mmx
  11.     y = y + mmy
  12.     IF x > _WIDTH THEN x = _WIDTH
  13.     IF y > _HEIGHT THEN y = _HEIGHT
  14.     IF x < 0 THEN x = 0
  15.     IF y < 0 THEN y = 0
  16.     _PRINTSTRING (x, y), "*"
  17.     _LIMIT 50
  18.  
  19.  
  20.  
  21. SUB GETMovement (MousemovementX, MousemovementY)
  22.     MousemovementX = 0
  23.     MousemovementY = 0
  24.     IF _MOUSEX < OMX THEN MousemovementX = -10 'set other values for other sensitivity
  25.     IF _MOUSEX > OMX THEN MousemovementX = 10
  26.     IF _MOUSEY < OMY THEN MousemovementY = -10
  27.     IF _MOUSEY > OMY THEN MousemovementY = 10
  28.     _MOUSEMOVE _WIDTH / 2, _HEIGHT / 2
  29.     OMX = _WIDTH / 2
  30.     OMY = _HEIGHT / 2
  31.  
  32.  

This code locks mouse in middle on the screen, but you can use own mouse pointers, using SUB values (star demonstrate mouse pointer). In my 3D world with OpenGL, released on .NET 2 years back, is it so solved and works correctly.
Title: Re: I'm looking for helpers to make a joint game
Post by: Galleon on May 21, 2020, 06:52:50 pm
MasterGy, this works by drawing the same triangle twice. The first time it is drawn it is drawn normally. The second time it is drawn it is applying a single color texture (black for darkness, blue for sky-haze) with various levels of opacity over the top of the previous triangle. The trick is to have a 2D texture where all 3 levels of opacity can be represented in a triangular fashion. _DEPTHBUFFER is locked to make sure that the drawing of the 1st triangle does not block the drawing of the 2nd triangle.

Also, if you want to improve to look of the game further I suggest you look into using a softer/more blurry texture when triangles are further away to avoid that pixelated effect you are seeing on those wood textures. I believe the technical term for this is mipmapping. Here's a random link to a video showing the difference:
Title: Re: I'm looking for helpers to make a joint game
Post by: MasterGy on May 22, 2020, 06:18:31 pm
I made the Z-depth buffer into a large array.
I still don't understand what calculations Galleon's code does, but
  based on his writing, I made it so that you don't have to count in real time, you just read the corresponding shader of the current maptriangle from an array.

The program works, it works nicely, I really like the light effect, the only problem is that it is slow. There are few maptriangles in the image, no real-time calculation, and yet very slow.

Why?

When you start the program, you can use the "p" key to toggle the z-depth buffer function on and off.

Why does the display stutter?



https://drive.google.com/file/d/1kOEs3utkWtDubd6Ea8iz4WuPO2YwN0HT/view?usp=sharing (https://drive.google.com/file/d/1kOEs3utkWtDubd6Ea8iz4WuPO2YwN0HT/view?usp=sharing)
Title: Re: I'm looking for helpers to make a joint game
Post by: MasterGy on May 22, 2020, 06:37:50 pm
see when z-depthbuffer is on, it's very choppy, lagging, stuttering



when displayed, it does not perform a mathematical calculation but reads from an array

Code: QB64: [Select]
  1. FOR actual_triangle = 0 TO triangles - 1
  2.         IF triangles(actual_triangle, 10) THEN
  3.             wx1 = points(triangles(actual_triangle, 0), 4): wy1 = points(triangles(actual_triangle, 0), 5): wz1 = points(triangles(actual_triangle, 0), 6)
  4.             wx2 = points(triangles(actual_triangle, 1), 4): wy2 = points(triangles(actual_triangle, 1), 5): wz2 = points(triangles(actual_triangle, 1), 6)
  5.             wx3 = points(triangles(actual_triangle, 2), 4): wy3 = points(triangles(actual_triangle, 2), 5): wz3 = points(triangles(actual_triangle, 2), 6)
  6.             maptris = maptris + 1
  7.             sx1 = triangles(actual_triangle, 4): sy1 = triangles(actual_triangle, 5)
  8.             sx2 = triangles(actual_triangle, 6): sy2 = triangles(actual_triangle, 7)
  9.             sx3 = triangles(actual_triangle, 8): sy3 = triangles(actual_triangle, 9)
  10.             _DEPTHBUFFER LOCK
  11.             _MAPTRIANGLE (sx1, sy1)-(sx2, sy2)-(sx3, sy3), pictri(triangles(actual_triangle, 3)) TO(wx1, wy1, wz1)-(wx2, wy2, wz2)-(wx3, wy3, wz3) ', , _SMOOTH
  12.             _DEPTHBUFFER ON
  13.             _MAPTRIANGLE (lb(actual_triangle, azbx, azby, azbz, 0), 256)-(lb(actual_triangle, azbx, azby, azbz, 1), 256)-(lb(actual_triangle, azbx, azby, azbz, 3), lb(actual_triangle, azbx, azby, azbz, 2)), lightmap33 TO(wx1, wy1, wz1)-(wx2, wy2, wz2)-(wx3, wy3, wz3) ', , _SMOOTH
  14.         END IF
  15.     NEXT actual_triangle
Title: Re: I'm looking for helpers to make a joint game
Post by: Galleon on May 23, 2020, 08:06:35 am
Firstly, I realised I over-complicated things with my "find triangle shape in alpha texture" approach. A texture with a single horizontal line of alpha values with all points on that line would have worked just fine.

You are most likely incurring a time penalty because:
a) Switching source textures too often
or
b) Switching between Z-buffer modes too often
With some logical experimentation you can identify exactly which is the case but I'm guessing (a) is the case.

If it is (a) you can possibly just add another line containing the alpha pixels to all of your textures (as long as you are not tiling them - specifying texture coordinates which loop, I doubt this is the case here).
If you want to get fancy you could add ambient, flat-lighting, and angle-based-lighting alpha line.