« first day (637 days earlier)      last day (4397 days later) » 

12:42 AM
" I am happy to announce that there is absolutely no Visual Basic code involved in any part of Trello. What’s next, flying cars?"
I enjoyed that :)
Installing Umbraco. Going to give it a test run
 
Umbraco?
That's like a sort of tool for tightening and loosing nuts and bolts? :P
 
Directly translation from Danish to English would be Umbracokeys. :P
No clue what their international name is.
 
Look like Hex Wrenches / Allen Wrenches as I've known them
 
whats the most efficient way to use path finder so that it stays up to date automatically
i dont like the idea of checking every frame it sounds horrific
 
12:54 AM
Have events for when the terrain might change?
That's how I handle most things, events keep periodic checks to a minimum.
 
hmm what if i could find a way to check if the changed terrain effected a given path and only change those paths =/
 
Like my Realm.SetTile method also invokes the TileChanged event with the position and the old and new tile.
 
oh wait my idea would only work for adding obstacles but not adding a new option
 
Well this installer feels pretty modern
I'm getting pumped
 
1:54 AM
Testing CMSs is more of a pain than you would think...
 
2:05 AM
0
Q: Logic to path finding checking

DaveI'm a little stuck on the logic to how i use my path finder efficiently in my game. This is basically how the game works: Building generates goods "Factory" > AI transports goods to "Warehouse" on path tiles > Warehouse receives goods > AI goes back to Factory. Now im wonderin...

would like to here some of you're logical thoughts on this
 
The question that comes to mind is why would a faster route become available?
Or unavailable as you say
 
if a user deletes a path tile it would no longer have connection to ware house
if user uses a upgraded path type which has faster walk time a faster route would be found
or if the user restructured their path tiles so its quicker
 
So shouldn't you only recalculate when those things happen instead of all the time?
 
yes but what about when initially placing the building too
 
I dont see the problem
 
2:13 AM
well im trying to reduce the amount of checking
 
Right... which is why I said only check when those things happen
 
but can u see any more improvement than that or is my logic pretty sound cos im not totally confident :P
like if i edit a path every building will have to recalculate right?
 
why not ?
 
Result 1: No path found> Keep checking every frame..
Why would you keep checking every frame?
 
2:16 AM
oh
ok good point :P
ill change that to path placed
 
So with your questions being
The two problems i have is: Well checking every frame is going to hurt the game's performance, secondly if I stop rechecking - it won't know when a faster route may become available or unavailable =/
The answer is to check based on events
 
Like I suggested about an hour ago...
 
ok that does sound better :P
 
You don't mention anything about rechecking for every building in your question. So if thats really your concern you might want to mention it ;)
@WilliamMindWorXMariager Yeah I remember seeing that :P
 
2:38 AM
i scared :P
 
Of?
 
how im going to do this particular thing
 
Me too :P
 
this is the design im testing
two factories to one ware house
i gotta find the two paths - then make them both change as i edit the path
i know im guna get it wrong but here goes xD
 
The more I test these CMSs the more I want to go back and doing my own simple CMS
 
3:15 AM
hmmm
take a look at this:
 
what about it
 
tiles arent syncing up right, it looks like a grid
when i draw it to its native resolution it looks fine
when i double the texture size it does this
 
because u have to make them about 2 pixels bigger than the actual grid
so they overlap
if u have 32 by 32
make the images 34 by 34
it will remove the lines u see
 
hmm
 
its a common thing that has to be done for isometric tiles too
 
3:17 AM
why would it not do this when the tiles are at their native resolution?
 
most likely due to reduction is size is ever so slightly too much than the actual grid
if say it did it by half a pixel out .. side by side ull have 1 pixel line
so to save the problems just give it a slightly larger size so they overlap
perhaps up the resize by 1 pixel
so if ur reducing by 10% make it 9%
an example would be say u have an image 15 pixels wide u half the width so its 7.5 pixels
it most likely rounds down
 
that change to +2 pixels didnt really help...
 
what are the image size + how much u changing their size by
 
original tile size is 16
im going to 32
 
so ur making it larger
 
3:21 AM
yea im doubling it
i tried changing the tile size to 34, didnt help
 
no need as the numbers are even numbers
hmm
oh wait are u changing the image size as a whole ?
as in ... change the width of the graphic within in the image by 1 or 2 pixels but keep the image itself the same
 
here is the line:
spriteBatch.Draw(t.Texture, new Rectangle((int)(x * TileWidth * Multiplier), (int)(y * TileHeight * Multiplier), (int)(TileWidth * Multiplier), (int)(TileHeight * Multiplier)),
where multiplier right now is just 2
 
language u using ?
 
xna, c#
 
so multiplier is 2 in this case?
 
3:23 AM
yes
 
I assume x, y, TileHeight, and TileWidth are all ints?
 
yea, i was playing with making multiplier a float hence the cast
but right now all the vars are ints
 
and return ints a not decimal
 
yes
 
try this... try reducing their size n see if the lines appear
so divide with multiplier
cos im wondering if xna adds some odd margin when it enlarges images =/
photoshop does it to reduce jaggies from pixelation as u enlarge
 
3:26 AM
that could be the case here
so sorry, let me make sure i understand
when i draw at a multiplier of 1 i get no margins
 
one alternative is make them large n use the reverse - u can zoom them smaller not larger assuming making them smaller does not create the grid lines
 
im afraid i dont know how to zoom in on a texture, im a bit new
i'll look into it
 
did u reduce their size and see if the lines occur?
 
JMRboosties, try changing the wrapping method.
 
@Dave let me get my microscope out
no lines on reduced size
@WilliamMindWorXMariager unsure what that means. is it a param in the draw method?
 
3:30 AM
what if you hard code some values
instead of doing multiplation put real ints in
 
@JMRboosties spriteBatch.Begin(SpriteSortMode.Deferred, null, SamplerState.LinearWrap, null,null);
See how it looks.
 
i 'think' the line is some anti alias effect added to enlarging images to keep it smooth looking which would create an alpha pixel margin around the graphic =/
 
also, can you confirm that the tiles line up? (X1 + Width) * Multiplier = X2
 
checkin on all these recommendations, h/o
 
When you scale images, it interpolates the pixels. In LinearClamp it'll give a transparent value when it samples outside the texture size. With LinearWrap it'll sample the opposite pixel.
It may not look perfect, but it should look a lot better with minimal work involved.
You may need to set the target profile to HiDef instead of Reach.
 
3:33 AM
ok i think william knows more than i but i suspect were thinking the same
 
We're not. :P There is no anti aliasing going on on 2D textures. :P
Anti aliasing has to do with smoothing jagged edges on 3D models.
 
@WilliamMindWorXMariager the spritebatch.begin suggestion didnt work unfortunately
 
they can be done on images too photoshop does it
alot of pixel artists use the effect when drawing circles
 
im going to try tyler's suggestion
 
@JMRboosties How did it look afterwards?
 
3:35 AM
@WilliamMindWorXMariager the same
 
Are you sure you did it right then?
 
@WilliamMindWorXMariager actually, it looked worse lol
 
might help to show us more of the code
 
the grid effect seems to be mostly vertical
when i did that recommendation it became horizontal as well
 
3:36 AM
I fixed it by drawing the scene on a RenderTarget2D and then just resizing that. Worked perfectly and was very versatile.
That's a bit more elaborate, but it's the perfect solution.
 
are they png images
or gif?
 
@Dave, Doesn't matter.
 
png
 
well it should be png if ur making a game william :P
 
Whatever the file format, the content pipeline turns it into a crossplatform XNB file.
 
3:37 AM
thats with linearwrap
 
You can use whatever image format the content pipeline supports, and it'll get turned into the same thing.
 
that has horizontal lines and vertical
 
@Dave right. when i do the regular spritebatch.begin call it is only vertical
 
the simple option would be make ur graphics in 32pixel by default.. but draw in 16 pixel by default in the game.... then they will work when reduced at 16 and native at 32
as its only when enlarging larger than their normal this issue occurs
 
@JMRboosties, Could you give me a link to the tilesheet so I can test something?
 
3:41 AM
sure thing
 
cant be the tileset if it works in default size + lower
 
prob the easiest way to do it
are you thinking double the tileset size to begin with?'
that makes more sense probably.
 
as in put them in photoshop n double their size yeh
rather than the code doing it
or have two sprite sheets one for each size
that would remove the image resizing from the code completely and might be better performance
debateable tho cos u use more graphical tile sets
u can bench test it im sure
 
yea
 
Try actually scaling them down and see if it fixes the issue.
 
3:48 AM
@JMRboosties let me try sumin a second with this image
 
@WilliamMindWorXMariager scaling them down?
 
@JMRboosties, this.spriteBatch.Begin(SpriteSortMode.Deferred, null, SamplerState.PointWrap, null, null);
Use that, it'll fix it.
Also, you really should cut that tilesheet up some. That's an awefully large texture.
 
@WilliamMindWorXMariager clutch man, that works!
 
if i can figure out how to break down my map editing program into multiple tiles i will
 
3:50 AM
ah u fixed it ?
break it up into relevant groupds
 
Like I said, it was a simple matter of how it sampled the texture. :)
 
groups
buildings from ground textures is a good start
 
i meant technically more than organizationally
but yea, thanks!
 
photoshop :P
 
haha i know that
tiled writes these map files to xml, im just curious how that will change the way its parsed with multiple tilesheets
 
4:01 AM
@tylerrrr07 eeeeeek imgur.com/AM6u1
i did it :D
 
now to figure out collisions!
 
thats easy
 
well i can do some basic collisions already
but i want to incorporate collisions with tiles here
tile-based movement
 
well if user is about to go to x5 y 10 ... check if x5 and y10 contains a collision if so dont walk it
use an array containing the x and y's that have collisions
logic code:
if(x in collision_array && y in collision_array[x]){ // u hit sumin }
have to use [x] on array to make sure its checking the Y related to that X
 
yea
thats what i was thinking
just need to implement correctly now
 
4:06 AM
cant help u there as i know nothing about you're code ;) and im off to bed night all
 
@Dave Good-bye
 
see you, thansk for the help
 
4:39 AM
Error loading "newmap". Cannot find ContentTypeReader for System.Single.
why would it be giving this error now... i havent touched the map processor at all
and of course launching the debugger on the processor wont work
 
5:18 AM
Well, I'm off - Hope you get that error solved JMR O:
 
5:43 AM
thanks man
 
 
1 hour later…
6:52 AM
@JMRboosties It seems like your Content and game class are different so deserialization fails
 
 
3 hours later…
9:36 AM
Trello's interesting, but how can it be good as that with no fees? what trello developers win in this trade? lol
 
10:36 AM
Any componend based programmer here? :)
 
Does Unity count? :)
But ask away. Someone will see your question... once.
 
Dont know :) How would you implmenet opening chests? For example i have tile based game, with non tile movement, i have character that moves next to chest and tryies to open it, what should i do? :)
Only thing i can think of is on keypress (handled somewhere in players component) i create new object with collision component (over the chest) chest and that object will collide sending message back to that new entity (which will somehow send it back to player) and some logic there will open chest
 
Why would you create a new collision component?
 
so i know that players "hand" (that new entity) collided with something (chest in this example)
or in unity in 3d, how would you do about opening chests
 
Well, if you want it to be on a key press, I'd just send a generic trigger to the object in the next tile that the player is facing.
You are already doing collisions for movement, right?
 
10:49 AM
yes but player movement is not tilebased
and what do you mean by sending a (generic) trigger?
i dont think i can find other entities from some component on player
 
I assumed that you have some kind of a map for which tile has which objects.
 
well take it that its unity and 3D game
 
What comes to my mind is to
have a collision component around the player, that registers objects on collision and unregisters them when they're not colliding anymore, and send messages to them when player does something.
Which actually looks like your idea in reverse.
 
11:09 AM
well i could have a collider that would always be a tile infront of my character and store what does it collide with
but its kind of non transparent :)
no one will understand why i do it, if i would crate entity hand... but thats creating a new entity thats wierd too
 
 
3 hours later…
2:29 PM
@gajet imgur.com/5bPSv oddly the path finder found the slower path
 
:/ that sucks
 
its been working for days but i been trying tons of combinations this is first time it failed
your fault john :P
 
@Dave what algorithm are you using?
 
a*
heuristic is manhatten i think
 
which is the source, and which is the destination?
 
2:35 PM
red is source
the purple is destination
 
are you treating the 4 tiles as one single destination?
 
and where is the heuristic measuring to? Maybe it's measuring to the left-most tile of the destination
 
Or the bottom-most
 
yup
Either of those cases could produce this path
 
yes the 4 tiles are one destination
 
2:38 PM
I'm assuming you're using integral indices? Or are you averaging the positions of the destination tiles?
 
umm well im using a script gajet created he would be better at answering this :P i don't know what integral indices are :P
tho i think it does favour the left most
but it was meant to only do that if two paths had equal result
sorry no comments in the script :P
 
well, from the decision point, it does prefer the left-most tile, all the way until it finds its destination
 
thought a* was meant to check all routes
and pick the fastest
 
you're right, I'm not taking into account the distance travelled
So... where are you measuring the heuristic to?
 
function getHur
in jsfiddle
jsfiddle really needs line numbers >.<
 
2:43 PM
I prefer logic
 
    function getHur(start) {
        var minHur = Math.abs(start.x - endObjs[0].x) + Math.abs(start.y - endObjs[0].y);

        for (var i = 1; i < endObjs.length; i++)
        if (Math.abs(start.x - endObjs[i].x) + Math.abs(start.y - endObjs[i].y) < minHur) minhur = Math.abs(start.x - endObjs[i].x) + Math.abs(start.y - endObjs[i].y);

        return minHur;
    }
 
Like... I don't know what endObjs[0] means
 
its bit long winded to explain ill be better off waiting for gajet
but it uses manhatten so it draws a straight line from a to b
which is its min huristic
 
well, I understand it's one of the tiles under the destination
but which one
 
well its in a for loop so it checks all four
 
2:46 PM
so endObjs is a list of all tiles under the destination structure
 
yeh
all 4 tiles in this case
its like:
[0].x
[0].y
that would be the x:y for one of the tiles
i cant remember why but it starts at 1 not 0
 
because you're already getting the heuristic for 0
 
oh yeah :P
 
what do you pass in as start?
 
2:50 PM
checking js fiddle now
 
I think I see the problem
Consider yourself on the tile where the branches meet; you can go down or right.
 
yer
 
If you go right, the tile's Manhattan distance is two away from the destination
If you go down, the tile's Manhattan distance is also two away from the destination.
 
yup
so then it only goes down ?
 
So it looks like you're pushing the "down" tile onto the stack after the "right" tile...so it gets popped first.
 
2:56 PM
hm
so would i need a different path finder algorithm
 
hi
 
The "down" tile's "down" tile is also 2 away from the destination, so it also doesn't get trumped by the "right" tile.
 
i have a little problem
 
ill have a fiddle with it @TreDubZedd thanks for explaining
ill be back later :) byee
 
i created simple chat server using java
and i connect to it using unity and "unityscript"
 
2:57 PM
@Dave I may be completely wrong, but that's what a quick glance seemed to indicate.
 
the problem is that when i want to post a message into networks stream
i have to close the stream after sending a message (in unity)
 
@Dave see en.wikipedia.org/wiki/A*_search_algorithm#Implementation_details
 

« first day (637 days earlier)      last day (4397 days later) »