Need a Tip

The Partridge Family were neither partridges nor a family. Discuss.
Post Reply
AliB
Posts: 3
Joined: August 4th, 2013, 10:51 pm

Need a Tip

Post by AliB » August 4th, 2013, 11:30 pm

Well I like your Tutorials... Awesome!!!
So I think you could help me ;) .
Thing is: I want to make a game with Ants and because I love these Animals and they seem to be perfect to implement to a Game, because ( until now ) there are only 20 known Operations they can do and they are quiet easy to implement ( I had c++ at the university, but only console-applications ).
Problem:
Ants leave a smell while looking for meal or something ( 20 operations ). I wanted to implement that by leaving parts of the PlayBoard behind the Ants "shine". But if they overlap the Shine is brighter ( hard to explain with words but really simple ).
I had two Ideas:
1: I define squares over the whole Playboard, so I can define the Strenght of smell by an intended Value, or
2: I use the defined Line-Method and calculate by distance.

I want the Program to work mostly efficient, and depending on the Size of the PlayBoard both seem to have their Advantage.
What would you prefer or do you have a better Idea of making it?
Whatever... Thanks Dude :D

p.s.: Why don't you include "string" or something from the "stl"? I know you are going Step by Step, but if you dont include them because of any Problems ( like Runtime ) I just have to know ;).

User avatar
LuisR14
Posts: 1248
Joined: May 23rd, 2013, 3:52 pm
Location: USA
Contact:

Re: Need a Tip

Post by LuisR14 » August 5th, 2013, 12:25 am

AliB wrote: Ants leave a smell while looking for meal or something ( 20 operations ). I wanted to implement that by leaving parts of the PlayBoard behind the Ants "shine". But if they overlap the Shine is brighter ( hard to explain with words but really simple ).
you could do try doing some color arithmetic, like for ex: multiply current pixel color with trail color (or something like that :P), for that you'd need a line drawing function that takes that into account :)
AliB wrote: p.s.: Why don't you include "string" or something from the "stl"? I know you are going Step by Step, but if you dont include them because of any Problems ( like Runtime ) I just have to know ;).
the chili already explains in one of his vids why he decided to use c-strings instead of stl strings (not gonna repeat it here since you can hear it in vid xP), and imo i like to use c-strings lol (that's just me, so meh lol)

(man i wish this forum had a quick edit option, something mybb already has :/)
always available, always on, about ~10 years c/c++, java[script], win32/directx api, [x]html/css/php/some asp/sql experience. (all self taught)
Knows English, Spanish and Japanese.
[url=irc://irc.freenode.net/#pchili]irc://irc.freenode.net/#pchili[/url] [url=irc://luisr14.no-ip.org/#pchili]alt[/url] -- join up if ever want real-time help or to just chat :mrgreen: --

albinopapa
Posts: 4373
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: Need a Tip

Post by albinopapa » August 5th, 2013, 3:34 am

You could section the world into blocks which would have various data about the blocks such as size, position, type and intensity of smell. As far as the intensity or brightness you could add the colors together and normalize to 1.0f or 255 if over these numbers, and create a "brighter or shinier" trail by increasing the radius of the glow.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com

User avatar
LuX
Posts: 1492
Joined: April 22nd, 2012, 12:33 pm
Location: Finland

Re: Need a Tip

Post by LuX » August 5th, 2013, 9:56 am

A bitmap is what I would probably go with. If you learn to use HLSL you could make the program use your GPU to do calculations using the image, that would speed it up potentially by 1000x haha.
ʕ •ᴥ•ʔ

AliB
Posts: 3
Joined: August 4th, 2013, 10:51 pm

Re: Need a Tip

Post by AliB » August 5th, 2013, 5:07 pm

Thank you all for your good tipps ( and the reminder that I have to listen more carefully to the Tutorials :D ). Well I think I try the tipp by LuX... I found some Pages about HLSL that I could use, but if you've got a tipp for a special page ( without any Payment ) I'd be very happy to know.

Again: Thank you everyone :)

User avatar
LuX
Posts: 1492
Joined: April 22nd, 2012, 12:33 pm
Location: Finland

Re: Need a Tip

Post by LuX » August 5th, 2013, 6:18 pm

Hmm, yeah I'm not really sure if that's even doable with c++... But you can always render the drawings with HLSL. To be honest I doubt your code will be that heavy that you will need to optimize it so radically. If you haven't completed chili's series it might be a bit early to tackle HLSL. I used primarily the tutorials from Rastertek, but now looking through the SDK examples.
ʕ •ᴥ•ʔ

AliB
Posts: 3
Joined: August 4th, 2013, 10:51 pm

Re: Need a Tip

Post by AliB » August 5th, 2013, 10:14 pm

Sure, I have to go Step by Step. I Just startet learning directX and that will take some Time... But it's always good to know what's the next Step.

Post Reply