Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411128 Posts in 69302 Topics- by 58376 Members - Latest Member: TitanicEnterprises

March 13, 2024, 09:06:20 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
  Show Posts
Pages: [1] 2
1  Developer / Technical / Re: [Java] DF fortress designer: "Quad"tree on: June 04, 2010, 07:15:58 AM


Here is a little graphic to illustrate it a bit better..
I made it this way so I dont have to check for every little cell,
instead if I know a CellBlock32 is empty I dont need to look inside and
can draw a block of 32x32 white pixels instead..

So each Cell represents a pixel..
each CellBlock16 has a 16x16 Array of Cells
each CellBlock32 has a 2x2 Array of CellBlock16's (32x32 Cells)
and finally each Layer has a (width/32)+1 x (height/32)+1 Array of CellBlock32

Because of this structure, I cannot directly access a Cell..
I have to calculate which CellBlock32.. then which CB16 Block.. and finally the Cell itself..

Like I said earlier.. I think I could do that with only one class
but I think my heads gonna explode if I try doing that.
Im glad that it works somewhat right now.. :/

If I use bytes or strings isnt that important right now and can be
changed easily later on.


What other file hosts can you recommend for small files?
2  Developer / Technical / Re: [Java] DF fortress designer: "Quad"tree on: June 03, 2010, 08:34:17 PM
Hello again, I coded long and hard on this and need some kind of "thats good" or "that sucks" on that Wink Its not an actual Tree with nodes and stuff, but 2D Arrays.
I think I could do it a bit more dynamical with only one class.. but for now Ill leave it like this to get some feedback..

The next thing will be getting some basic drawing done with this new datastructure.

http://www.2shared.com/file/BEXD9pA_/src.html

btw: you can actually see something in the console!
you can also fiddle around with height and width in DFTest.java

Thanks for your feedback!
3  Developer / Technical / Re: [Java] DF fortress designer: How to save the map? on: June 01, 2010, 06:32:44 PM
Hm I think Ill do both.. for some extra practice. But Ill drop the byte stuff. Id rather not sacrifice readability of my own code than to have a little more RAM, which shouldn't be a problem nowadays.

Oh my, this sounds like fun Smiley

Thanks (again) Dacke & Zaratustra
4  Developer / Technical / Re: [Java] DF fortress designer: How to save the map? on: June 01, 2010, 04:47:35 PM
heh I already read your post and wanted to reply with this info.
its hard to tell, it depends on the variable..
like I said in my original post, these variables hold the keys which are pressed(easy example: dig hotkeys) or interpreted(example: stockpiles/place) by the Autohotkey Script of another program.

for dig its easy, there are 17 single hotkeys
so there should be only one char stored into a variable.

for build its a bit more complicated.
there are several groups in the menue so you need sometimes 2 characters
or modifiers like Shift or Alt to reach the option.
in all there are 78 unique states.
There is also one option which is a special case which is described below*.

for place its even more complicated.
this is where you place a stockpile which is as wide and high as
many keys are pressed.. I want to save already in a way to write
it directly into the Quickfort-readable .csv.
*The content will be a String looking like this: "f(2x5)"
So a "f"ood stockpile will be placed 2 tiles wide and 5 tiles high.
I cant think of a way to put that into a byte Sad

for query.. uhm I really dont know.
its hard to look that one up since its a context sensetive operation
and the keys differ, depending on which workshop/furniture has been built.
What I do know is the content can be many characters long.
This may be the "biggest" variable, but the most unused one too!

Have a look here http://sun2design.com/quickfort/
to get an idea what the final .csv will look like and what it represents,
but I hope I explained it well enough already.

Also, I probably export this into a textfile for an easier way to extend the commands when new things are added into the game and the menue gets new hotkeys.
5  Developer / Technical / Re: [Java] DF fortress designer: How to save the map? on: June 01, 2010, 03:10:23 PM
you might as well go the full monty and copy DF's storage method. DF marks each 40x40x1 block as empty or not.

In this case, you'd have a tridimensional array of blocks, each of which points either to null (meaning an empty block) or to a 40x40 array of tiles.

ah I see, the idea with the octtree makes sense now..
if thats how things are in game, then ill do that too Smiley
...
What is the expected max size of a map? (max length, width, depth)

The super-easy way to do it is indeed a three-dimensional array. I would guess that it will require too much memory (as you suspected) but it wouldn't hurt to actually find out. Do you have the numbers?
..well, the height and width of a layer wont be changed much, but layers will be added
fairly often I think. In the df magma wiki says there can be up to 600 z-levels (layers), but I think if I hard limit it to 200 there wont be any problems.
Maybe I can use a hard limit for width and height of 200 each for a layer too..
This seems the default map height/width used in DF chosing a embark site.
So its Cell map[200][200][200].
I guess I should try filling it up with random stuff to find out how much memory it uses?

Thanks for the input guys!
6  Developer / Technical / [Java] DF fortress designer: "Quad"tree on: May 31, 2010, 06:01:26 PM
Hi everyone.. again.

So some of you may know Im working on a "simple paint program" which actually is quite right but not the whole truth. In the end, I want to do a Dwarf Fortress fortress designer. I know there is already one (or two?) out there which I dont really like to use Sad, so I want to make my own and use it in Quickfort.

So far the plan was "pixeling" the fortress, each color standing for a specific keystroke.
Soon I realized you'll get overwhelmed by many different colors if I want to support every feature Quickfort has to offer.
Therefore I decided to use tiles instead.

For all who dont know dwarf fortress here is a little illustration:

(in the editor, as well as in the game you see one layer
at a time, like in any image editor)

As you can see the Map consists out of several Layers.
Each Layer has several Cells.
Each Cell has variables called: dig, build, place, query.
(like the naming convention in Quickfort for using keystrokes within specific context)

These 4 variables should contain the keystrokes for Quickfort.
(nonsensical but syntactical correct Example: "b{Left}{Left}{Enter}")

and the Question is?
Which Datatypes / Collections should I use to make drawing the cells
effecient? I dont think I should use a Array like "Cell map[][][]"..
cause I have to go through every cell and probably most of them stay empty anyway..
There are many things like HashMaps, ArrayLists, Sets..
So what should I use?

Currently I have ArrayLists like this:
Is that it? or

Code:
ArrayList<Layer> map;

class Layer{
 ArrayList<Cell> content; //when using x,y in the cells
                          //I need to sort them too before exporting!
}

class Cell{
 int x, y;        //where on this layer is this cell
 String phase[3]; //0 = dig, 1 = build, ...
                  //a assoziative array would look nicer
}



I thought long and hard about this and I hope I dont step on anyones toes if I open up another thread asking something, but I well Im clueless. At this point I want to thank everyone again who reads this and/or tries to help Smiley
Thank you

7  Developer / Technical / Re: [Java] Zooming & Grid on: May 27, 2010, 05:15:49 PM
that sounds horrible slow.
otherwise i cant imagine another way to make a grid possible.
when i draw pixel per pixel that way, i could leave space to draw the grid.
that would "solve" the grid problem..
8  Developer / Technical / [Java] Zooming & Grid on: May 27, 2010, 04:25:41 PM
hello everyone.

Im currently developing a kind of pixel editor. therefore, zoom functionality is mandatory.
I want to avoid posting all the code, so I hope this overview of how the app is structured is enough to get the idea.

I have these classes:

Painter (extends JApplet):
The main class here I do stuff so the PaintScrolling shows up

PaintScrolling (extends JScrollpane implements MouseWheelListener)
In here I have a PaintPanel "_canvas" and the zoom functionality which currently looks like this:
Code:
public void zoomOut(final MouseWheelEvent e)
    {
        // Get the mouse position with respect to the zoomPanel
        final Point pointOnZoomPanel = SwingUtilities.convertPoint(
                        e.getComponent(), e.getPoint(), _canvas);

        // Resize panel
        final Dimension currSize = _canvas.getSize();
        _canvas.setPreferredSize(
                        new Dimension(
                                        (int)(currSize.width * ZOOM_OUT_FACTOR),
                                        (int)(currSize.height * ZOOM_OUT_FACTOR) ));

        // find out where our point on the zoom panel is now that we've resized it
        final Point newViewPos = new Point();
        newViewPos.x = (int)((ZOOM_OUT_FACTOR * currSize.width) * (e.getPoint().x/(double)currSize.width));
        newViewPos.y = (int)((ZOOM_OUT_FACTOR * currSize.height) * (e.getPoint().y/(double)currSize.height));
       
        // move the viewport to the new position to keep the area our mouse was in the same spot
        getViewport().setViewPosition(newViewPos);

        _canvas.revalidate();
        repaint();
    }

PaintPanel (extends JPanel implements Mousestuffs)
This is the actual canvas I draw on..
In here youll find the BufferedImage.


My question is: What do I need to do to scale the image and gets all pixely?
So I want to draw in such a state of course but how do I "translate" it back
into the original image..

Also, I want to add a Pixelgrid.. which makes me confused everytime I think about it Sad
I absolutely have no idea how I should do that.. Sad

On request I could upload the source.

Thanks for your help and time.
9  Developer / Technical / Re: Draw stuff in Java on: May 21, 2010, 07:01:18 AM
yeah I already do that. but mouseDragged() is a little slow and cant process all the mouse positions when you move your mouse, resulting in missing pixels.
to fill in the "gaps" you can use drawLine but thats not pretty either.
10  Developer / Technical / Re: Draw stuff in Java on: May 21, 2010, 05:48:04 AM
Heh, thanks but I "just" want to do a pixel editor.
Though its hard enough for me to figure out how to zoom in and to have a pen tool
which doesnt use drawLine to fill in the gaps when the mouse is moved too fast.
ah well, ill figure that out somehow.

now that i know that i have to google for "paint" and not "image/pixel editor"
^^
11  Developer / Technical / Re: Draw stuff in Java on: May 20, 2010, 02:05:39 PM
Ahhhh,.. a nice simple example.. just the thing I wanted Smiley)
Thank you so much!

btw did you google that?
12  Developer / Technical / Draw stuff in Java on: May 20, 2010, 01:26:39 PM
Hi all

I already know a bit of Java. In fact, I know enough that documentations can be a bitch and it happened more than one time that I just don't get the overall picture of things.
Yeah I did some googleing but still, after reading the sun tutorial on 2D Graphics I still don't get it what I need to do to get a white canvas with the ability to draw when the mouse is pressed down.

So can anyone give me a little push in the right direction :/?

thanks
13  Developer / Art / Re: Pixeleditor with "workspace" like Illustrator? on: May 20, 2010, 11:54:50 AM
Just to clarify what we are talking about:



Notice how it's possible to scroll into the workspace, even though the canvas has ended.

Example taken from GIMP.
Both GIMP and Photoshop have this functionality. But, as you all know, they are multi-task-tools. So this doesn't answer the original question.

Yes thats what I mean. This should be independent of your zoomlevel. Thats only important when zoomed in so much, that your image becomes larger than your screen/window. if you try to scroll when zoomed in really close, most Apps dont add any "extra" free workspace (like in the picture above) to scroll.

So the corner of the image stays always in the corner of your window/screen.
like this:


Uploaded with ImageShack.us

Nonetheless its good to know which tools have this feature Smiley
14  Developer / Art / Re: Pixeleditor with "workspace" like Illustrator? on: May 19, 2010, 02:44:14 PM
so uhm.. is it somehow clear what im trying to say? :/
15  Developer / Art / Re: PixelProspector.com Logo Design? on: May 10, 2010, 10:23:58 AM
I like the top one the most..
but the middle one could be better if the colors of the pattern are more subtle..

also the miners pick/beard is a bit hard to recognize..
maybe a bit different colors could do the trick
16  Developer / Art / Pixeleditor with "workspace" like Illustrator? on: May 10, 2010, 10:11:36 AM
So Ive heard Graphicsgale is the word on the street but Im missing a bit of freedom when zooming in big time, like 2000%..

In Illustrator you are able to scroll and position your "Image Area" so that any corner of the image fits in the center of your screen.. where in Graphicsgale and many other editors, when zoomed in, your scrollable area ends when the image ends.

Is there an option to change this or is there a pixel editor with such behaviour?

thanks
17  Developer / Design / Shrrom Shroom - "Smash Brother"-ish, eat Mushrooms on: January 30, 2010, 06:03:30 PM
Shrrom Shroom!

Introduction:
First of all, I dont know exactly were to put this, so I hope something more specific like this still fits in with all those more broad topics about game design.

I dreamed about this game and it probably was the fault of Super Mario War and a screenshot of a game made for the Ludum Dare contest. The game was about mushrooms too. So this dream botherd me now for a week, always came to my mind that i should write it down or something. Now that I did, I felt bad about it cause I'm probably not going to code it (several reasons). So that bothered me again for some 2 days and now i thought this is a good place to post this idea..

So if anyone feels inspired or even makes this, it will make me happy it did so Smiley.

Core Features:
Its about beating the crap out of each other.
You are able to eat up to 3 Mushrooms gain powers.
While using your Powers you are able to alter your surroundings.

Mushrooms:
Fire
Water
Poisen

 Who, Me?
Close Combat
stronger
fewer charges
(maybe reducing charges of a Water-Wielder on Hit?)
Long Range
weaker
more charges
(maybe reducing charges of a Fire-Wielder on Hit?)
Middle Range
reduces Health after peroid of time
one Charge
spreads fast on release, gets slower



Sprawl
Strengthen
Change
???
+(Fire/Water) gives more Charges
+(Poisen) lengthens effect
(eat alone) cures Poisen if poisened or gives Health back (but not both)
+(Fire/Water/Poisen) increases Damage
(eat alone) increase strength of standard attack.
+(Fire)Turn into a unstoppable Magmaball which is always in motion.(additional damage to Water-Wielders)

+(Water)Turn into a ball of Water which can sprint a short distance and knock everything in its path away.(additional damage to Fire-Wielders)

+(Poisen) Turn into a cloud of Poisen which damages on contact (slow movement?)

(eat alone) ?

[there are some Combinations not covered]

Ultimate Combos:
Strengthen+ Change + Fire
Turn into a Vulcano: Wreck havoc by controlling Fire Balls which shoot out of the ground.

Strengthen+ Change + Water
Turn into Rain: Rain drops (hard as steel) shoot down from above automagically. Control the wind to change the drops direction.

Strengthen+ Change + Poisen
Turn into Enviroment: You control: flowers which are able to spit out clouds of poisen which hover in the air for some seconds, tendrils which extend poisonous thorns, ...

Misc. Notes:
The collected mushrooms are always visible for each player and are represented by a colorfull Icon/Orb floating around the Player.

When a player eats mushrooms, s/he will eat them all at once (you cant eat just one of the Mushrooms youve collected Mushroom). --> The order in which the mushrooms were collected doesnt matter.
Mushroom need time to be digested? ( --> weak while digesting?, --> the longer the stronger the effect? )

All powers are temporary, although they can be enhanced in duration and strength.

When acquiring a power, a glow surrounding the player will get weaker indicating how long its going to last. (when having 3 secounds left -> blinking glow?)

While wielding a power you cant eat any mushrooms, but you are still able to collect them.

Fire-Wielders are able to burn the enviroment when using their power.
Water-Wielders do the opposite.
Poisen is neutral.

Enviroment should have some effects on the players.. (and their powers? like the Ultimate Poisen Change)
18  Community / Assemblee: Part 2 / Re: Dungeons of Fayte: 1-4 Player Co-op RPG/Sim [FINISHED] on: January 10, 2010, 07:09:59 PM
totaly loved it! though i couldnt play it with some other players right now, so i lost all the way Wink
19  Player / Games / Re: Love Alpha ONLINE - Voucher Codes! on: September 30, 2009, 07:19:21 AM
oh me me please Smiley) currently dont have enough money on my bankaccount.. and to transfer it to paypal takes ages..
20  Player / Games / Re: Love Alpha ONLINE - Voucher Codes! on: September 30, 2009, 07:07:19 AM
it would have been posted sooner or later on tigsource / rps..
just wanted to keep ya all on yer toes Smiley

btw i didnt read / dont know how much playtime you get or if its a one time fee for the alpha though on the page he explains how you can spend / earn additional playtime.

hm, have to try it out i guess.
Pages: [1] 2
Theme orange-lt created by panic