Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Work in Progress / [DBP] Grass/Statics Engine! and new additions ;o)

Author
Message
gwheycs62egydws
13
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 9th Mar 2011 04:21 Edited at: 9th Mar 2011 04:27
some time ago like in 27th Aug 2007

Creator: coolgames

created a 3d "[DBP] Grass/Statics Engine!" in code Snippets

this is the link to his work
http://forum.thegamecreators.com/?m=forum_view&t=113222&b=6

thanks to talking with him I've added a bit more to it and have
plans to add more to help build your levels quicker and with more
options

Please keep checking back I will do what I can to expand the options

If a thought is Just a thought ~ so whats the main thought ?

Attachments

Login to view attachments
gwheycs62egydws
13
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 9th Mar 2011 04:23
additions planed for this are:

to be added list

grass that shows be pressed down by the user
- it could stay permently that way
- it could come back up after a time that was set

zoomable camera

Clouds
- static
- moveing around
- moving around and changeing

day evening night morning change

mist

fog

Rain
- lightning

snow
- snow piles

snow will be a bit more tricky to implement
not so much as having come down from the sky
but it collecting in a spot and piling up

sound of movment though the grass
either slow average or running

If a thought is Just a thought ~ so whats the main thought ?
gwheycs62egydws
13
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 9th Mar 2011 04:23
what I added after the do line was

if inkey$()="a" then maxrd=maxrd-1:if maxrd<10 then maxrd=10
if inkey$()="s" then maxrd=maxrd+1:if maxrd>5000 then maxrd=5000
set_static_render_dist(maxrd)
the bigger the number you go the slower things get

this changes how far out the grass is shown

the line that gets thing going for creating the grass and the distance
it shows from the center of the players is

st_grass=load_static_type("statics\grass_2.x",25,25,25,0,4,0,255,0,3000,1,0,maxrd,0,0,0)
`
` the 3000 # is the distance they cover

it was originally set at 700 I changed that to 3000

If a thought is Just a thought ~ so whats the main thought ?
Quel
13
Years of Service
User Offline
Joined: 13th Mar 2009
Location:
Posted: 9th Mar 2011 11:31
Well, i feel like there is more to do with it on the art side, than coding, but that would require refinements as well.

I would make the ground texture grass too, because the contrast is just too high this way. OR you could also do it a way like the ground would have two or more levels of texture: the far parts are real time textured as grass, while the closer it is, it changes into simple ground texture. Creating a nice smooth transition between fake and real grass.

Also the grass placement should be smoothed out, put more closer, and how they get more far, there would be only a couple scattered around.

And with my 5 fps, it was VERY obvious, that the engine creates only the stuff that is currently onscreen. Somehow make it faster, or put some on the edges outside of screen, so popping won't be there with even sudden turns.

Very nice, I'm also gonna make something like this for my own game.
gwheycs62egydws
13
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 9th Mar 2011 20:46
this is one every one can get a better idea
on how to build a such a place

a lot has to be balanced just right or it slows things down

since I do not fully understand how it was built at this point

I am playing around with peaces until I completely understand
all the parts

If a thought is Just a thought ~ so whats the main thought ?
Quel
13
Years of Service
User Offline
Joined: 13th Mar 2009
Location:
Posted: 10th Mar 2011 10:12
ehm... this isn't made by you?
gwheycs62egydws
13
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 10th Mar 2011 10:16
ehm nope

I'm not that smart yet
but the understanding is slowly coming into play ;o)
so to speak that is

if I can add what I think is needed then I expand my understanding
for my own projects

If a thought is Just a thought ~ so whats the main thought ?
Stab in the Dark software
Valued Member
20
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 13th Mar 2011 23:56
Quote: "if I can add what I think is needed then I expand my understanding
for my own projects"


Resourceful That's How We all learn. I'm going to look over this project,and any suggestions I will post back here. I'm sure other forum dwellwers will make suggestions.

[img][/img]



Custom,intel 3.0GHz Hyper Threaded,4GB RAM,ATI X1500 256mb,
WindowsXP DBpro v7.5 Synergy
The coffee is lovely dark and deep,and I have code to write before I sleep.
gwheycs62egydws
13
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 14th Mar 2011 00:12
yeppers

I've got a compete list of what I think it should have
it's just a matter of me figuring out how to do it

some will be easy
and a couple will be a brain twister

I found a dll in the forum
that lets you computer speak

I made a ini it so DBP high lists the words
about 15 minutes to figure that one out

it had a command to list all the voices the computer had

well i wanted to break down the listing down
and have spent nearly all day working on it

and just when I get it going
I decided to change variable names to makes things
more clearer
unforchantly now it dose not display

I had a plan the computer program had it's own plan
and now I have to plan how to make it work

If a thought is Just a thought ~ so whats the main thought ?
gwheycs62egydws
13
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 7th Apr 2011 08:03
hey all

I've got a bit back logged

I am still trying to understand how this example was built
so I can expand it

If a thought is Just a thought ~ so whats the main thought ?
gwheycs62egydws
13
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 6th Jun 2011 11:11
I'm still looking though the code and picking
up new additions to DBP

If a thought is Just a thought ~ so whats the main thought ?
GeeBee
14
Years of Service
User Offline
Joined: 26th Aug 2008
Location:
Posted: 24th Jun 2011 10:24
Like Resourceful, I am looking at this code (downloadable from the original snippet) and 'educating' myself in the mysteries of memblocks et al.

However, I believe this code has two problems:
1. It flips vertically the resulting position of the entities (grass/trees etc) compared to the mask image. Use attached image to replace the original - a line of trees should be "in front" ("north of") of the camera upon loading, but in fact they are behind.
2. It uses 'Blue to place the trees, not 'red' as indicated by rgb 255,0,0 - but I can't find any obvious code transpositions etc.

I think problem 1. may be because the image origin is read starting from the top left corner, but entity placement from the bottom left corner -but I can't figure out how to resolve.

Problem 2 eludes me completely.

Can anyone confirm a)the problem and b)spot a solution?

Habits can get you into trouble sometimes (unless you are a nun....)

Attachments

Login to view attachments
Quel
13
Years of Service
User Offline
Joined: 13th Mar 2009
Location:
Posted: 24th Jun 2011 11:38
What if you all just totally rewrote it from scratch...

-In.Dev.X: A unique heavy story based shoot'em ~35%
-CoreFleet: An underground commander unit based RTS ~15%
-TailsVSEggman: An Sonic themed RTS under development for idea presentation to Sega ~15%
GeeBee
14
Years of Service
User Offline
Joined: 26th Aug 2008
Location:
Posted: 24th Jun 2011 13:05
Quel

Because then I won't learn! I am looking at code that all looks fine to my eye - no obvious typos, obviously runs etc, yet doesn't produce the expected result. I'm fairly confident I could construct my own array based solution, but that doesn't get to grips with memblocks.

I have checked the code I understand - typed arrays, for..next loops and the general purpose of each function.

Notwithstanding errors on my part in these areas (always possible), I have to assume it is the 'memblock 'bits' and related DBPro command sets that I am unfamiliar with that are the underlying issue.

In some ways my request for help was equally about the best way to troubleshoot this particular code and thus identify the area to target.

If you wish to assist in the process, thoughts would be gratefully received.

Habits can get you into trouble sometimes (unless you are a nun....)
Max P
13
Years of Service
User Offline
Joined: 23rd Jan 2010
Location:
Posted: 24th Jun 2011 19:13 Edited at: 24th Jun 2011 19:15
@GeeBee

Haven't looked at the code yet, but for 1. you can use image width-x or something similair to flip the positions. for 2.. rgb is turned to bgr in memblocks, altough I'm not sure about that.
Quel
13
Years of Service
User Offline
Joined: 13th Mar 2009
Location:
Posted: 24th Jun 2011 19:44
I'm way out of the stage of editing others' codes to learn so it was my point of view. Though still i don't think that starting on your own is the total opposite of learning anything

I would love to write something like this, actually was going to but later realized that my main project doesn't require real like grass at all... (top-view shmup..)

How i would get started right now consists of two major parts.

1.: Make a little particle system which handles a required amount of small grass groups.
2.: Make a required size virtual matrix using an array, and calculate the visible area of the level on it according to the camera perspective.

Then you just assign a grass group to the 1's on this matrix, and unassign if there is anything from the 0's.

The 1's on the matrix actually could be numbers ranging from 1 to X, and this would mean that how many limbs of the grass group is visible, thus achieving a nice transition from many grass to nothing at all due to distance.

Of course this sounds so easy just talking about, but right now i think the concept would be pretty efficient and nice looking, though i don't have time now to make it happen.

-In.Dev.X: A unique heavy story based shoot'em ~35%
-CoreFleet: An underground commander unit based RTS ~15%
-TailsVSEggman: An Sonic themed RTS under development for idea presentation to Sega ~15%
GeeBee
14
Years of Service
User Offline
Joined: 26th Aug 2008
Location:
Posted: 24th Jun 2011 22:36
Max P
Thanks - For 1. I've used a variant of your suggestion, by manipulating the 3D Z coordinate rather than the 'height' pixel of the image. This seems to work. For those interested the two functions that need changing now look like this (italics=remmed out original code)

I don't particularly like this workround as it niggles me that the memblock image is still 'upside down', but at least the final output works.

Quel - thanks. If I understand you correctly, Coolgame's original code sort of does the same thing by creating a 'virtual matrix' (= the mask image in memblocks) and dynamically reading the 1's and 0's (=the pixel colours) in order to determine which object type to place and display.
I have no idea of the relative merits of each approach, but I like the visual element of 'painting' the statics into the places where I want them.

Resourceful - apologies for a mini-hijack of your thread

Habits can get you into trouble sometimes (unless you are a nun....)
gwheycs62egydws
13
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 2nd Jul 2011 13:23
for the time this was built it was very advanced

even now with new additions coming to the DBP Audion's

the code presented so far gives pointers
to what is possible

If a thought is Just a thought ~ so whats the main thought ?
GeeBee
14
Years of Service
User Offline
Joined: 26th Aug 2008
Location:
Posted: 2nd Jul 2011 15:14
Be aware there is a small error in the code that leaves a "blank spot" when approaching a static from the 'south'/below/180degrees. This causes the static to pop out of sight and then back into sight as you get close to it, until finally disappearing as you pass over the top of it.

I have tried:



I thought this fixed it, but it seems to introduce a different issue, so I'm now tinkering with the whole 'updateStatic' function.

All good fun....

Habits can get you into trouble sometimes (unless you are a nun....)

Login to post a reply

Server time is: 2023-02-08 23:46:00
Your offset time is: 2023-02-08 23:46:00