GtkBzedit's New Release

Discussion, updates, modifications, etc for the various map editors...
Post Reply
User avatar
nn
Private First Class
Private First Class
Posts: 50
Joined: Mon Jun 11, 2007 10:47 pm
Location: PA
Contact:

GtkBzedit's New Release

Post by nn »

Hi,

http://userbin.net/gtkbzedit_2.2.tbz2

I have been working on my own #C editor for a while and here is the Brand new release !!!! Unlike most editors this one has a bunch of goodies built in to the interface and doesn't require a graphics card that uses 3d. Well at least it doesn't require that yet its a eventual planed add on. right now it has its own 3d mesh transform equations built in.

As of current the editable objects are as fallows if a object has disabled in fount of it it means that it has some code in the program but not enough yet to actually edit, save and reliably read that object:

(Disabled)ARC
BASE
BOX
(Disabled)COLOR
(Disabled)CONE
(Disabled)DEFINE
(Disabled)DYNAMICCOLOR
(Disabled)GROUP
LINK
(Disabled)MATERIAL
(Disabled)MESH
MESHBOX
MESHPYR
OPTIONS
PHYSICS
PYRAMID
(Disabled)SPHERE
TELEPORTER
(Disabled)TEXTUREMATRIX
(Disabled)WATERLEVEL
(Disabled)WEAPON
WORLD
ZONE

It can locate and read most of the fallowing arguments (This below segment was coyed from the code:

if(!strncmp(str, "box", 3)) g->s = sym_box;
else if(!strncmp(str, "position", 8)) g->s = sym_position;
else if(!strncmp(str, "rotation", 8)) g->s = sym_rotation;
else if(!strncmp(str, "size", 4)) g->s = sym_size;
else if(!strncmp(str, "end", 3)) g->s = sym_end;
else if(!strncmp(str, "border", 6)) g->s = sym_border;
else if(!strncmp(str, "angle", 5)) g->s = sym_angle;
else if(!strncmp(str, "base", 4)) g->s = sym_base;
else if(!strncmp(str, "color", 5)) g->s = sym_color;
else if(!strncmp(str, "delay", 5)) g->s = sym_delay;
else if(!strncmp(str, "divisions", 9)) g->s = sym_divisions;
else if(!strncmp(str, "drivethrough", 12)) g->s = sym_drivethrough;
else if(!strncmp(str, "flagheight", 10)) g->s = sym_flagheight;
else if(!strncmp(str, "flatshading", 11)) g->s = sym_flatshading;
else if(!strncmp(str, "from", 4)) g->s = sym_from;
else if(!strncmp(str, "initdelay", 9)) g->s = sym_initdelay;
else if(!strncmp(str, "link", 4)) g->s = sym_link;
else if(!strncmp(str, "name", 4)) g->s = sym_name;
else if(!strncmp(str, "passable", 8)) g->s = sym_passable;
else if(!strncmp(str, "pyramid", 7)) g->s = sym_pyramid;
else if(!strncmp(str, "ratio", 5)) g->s = sym_ratio;
else if(!strncmp(str, "scale", 5)) g->s = sym_scale;
else if(!strncmp(str, "shear", 5)) g->s = sym_shear;
else if(!strncmp(str, "shift", 5)) g->s = sym_shift;
else if(!strncmp(str, "shootthrough", 12)) g->s = sym_shootthrough;
else if(!strncmp(str, "smoothbounce", 12)) g->s = sym_smoothbounce;
else if(!strncmp(str, "flipz", 5)) g->s = sym_flipz;
else if(!strncmp(str, "teleporter", 10)) g->s = sym_teleporter;
else if(!strncmp(str, "to", 2)) g->s = sym_to;
else if(!strncmp(str, "type", 4)) g->s = sym_type;
else if(!strncmp(str, "weapon", 6)) g->s = sym_weapon;
else if(!strncmp(str, "world", 5)) g->s = sym_world;
else if(!strncmp(str, "spin", 4)) g->s = sym_spin;
else if(!strncmp(str, "meshbox", 7)) g->s = sym_meshbox;
else if(!strncmp(str, "meshpyr", 7)) g->s = sym_meshpyr;
else if(!strncmp(str, "material", 8)) g->s = sym_material;
else if(!strncmp(str, "physics", 7)) g->s = sym_physics;
else if(!strncmp(str, "zone", 4)) g->s = sym_zone;
else if(!strncmp(str, "phydrv", 6)) g->s = sym_phydrv;
else if(!strncmp(str, "matref", 6)) g->s = sym_matref;
else if(!strncmp(str, "linear", 6)) g->s = sym_linear;
else if(!strncmp(str, "angular", 7)) g->s = sym_angular;
else if(!strncmp(str, "slide", 5)) g->s = sym_slide;
else if(!strncmp(str, "death", 5)) g->s = sym_death;
else if(!strncmp(str, "texture", 7)) g->s = sym_texture;
else if(!strncmp(str, "addtexture", 10)) g->s = sym_addtexture;
else if(!strncmp(str, "notexture", 9)) g->s = sym_notexture;
else if(!strncmp(str, "notexcolor", 10)) g->s = sym_notexcolor;
else if(!strncmp(str, "notexalpha", 10)) g->s = sym_notexalpha;
else if(!strncmp(str, "texmat", 6)) g->s = sym_texmat;
else if(!strncmp(str, "dyncol", 6)) g->s = sym_dyncol;
else if(!strncmp(str, "ambient", 7)) g->s = sym_ambient;
else if(!strncmp(str, "diffuse", 7)) g->s = sym_diffuse;
else if(!strncmp(str, "specular", 8)) g->s = sym_specular;
else if(!strncmp(str, "emission", 8)) g->s = sym_emission;
else if(!strncmp(str, "shininess", 9)) g->s = sym_shininess;
else if(!strncmp(str, "zoneflag", 8)) g->s = sym_zoneflag;
else if(!strncmp(str, "flag", 4)) g->s = sym_flag;
else if(!strncmp(str, "team", 4)) g->s = sym_team;
else if(!strncmp(str, "safety", 6)) g->s = sym_safety;
else if(!strncmp(str, "texturematrix", 13)) g->s = sym_texturematrix;
else if(!strncmp(str, "center", 6)) g->s = sym_center;
else if(!strncmp(str, "fixedscale", 10)) g->s = sym_fixedscale;
else if(!strncmp(str, "fixedspin", 9)) g->s = sym_fixedspin;
else if(!strncmp(str, "fixedshift", 10)) g->s = sym_fixedshift;
else if(!strncmp(str, "cone", 4)) g->s = sym_cone;
else if(!strncmp(str, "sphere", 6)) g->s = sym_sphere;
else if(!strncmp(str, "radius", 6)) g->s = sym_radius;
else if(!strncmp(str, "options", 7)) g->s = sym_options;
else if(!strncmp(str, "oncap", 5)) g->s = sym_oncap;

Good luck with it,
NN
User avatar
nn
Private First Class
Private First Class
Posts: 50
Joined: Mon Jun 11, 2007 10:47 pm
Location: PA
Contact:

Help built in to application

Post by nn »

I thought to give people an idea of some of the other things this app can do I would post the bi;t in help section here.

Welcome to GtkBzedit: \n \
\n \
\n \
Help:: \n \
\n \
Entry box:\n \
\n \
The Entry Box is fairly simple but \n \
there are two things that should be noted. \n \
\n \
1. The Entry box lists all objects but the objects \n\
that have a (Disabled) are not yet supported by \n\
by this version of the editer. Thoes objects will \n\
not be able to be read from the map or saved to it \n\
\n \
2. You will notice that entrys will appear and dissapear \n\
Depending on the object type. \n \
Keys: \n \
\n \
Normal: \n \
PgUp: zoom in (z) \n \
PgDown: zoom out(z) \n \
Up: Rotate up (z) \n \
Down: Rotate down (z) \n \
\n \
Fliped mode: \n \
PgUp: Rotate up (z) \n \
PgDown: Rotate down(z) \n \
Up: zoom in (z) \n \
Down: zoom out (z) \n \
\n \
------------ \n \
Left: Rotate left \n \
Right: Rotate right \n \
\n \
u: subjective \n \
p: perspective \n \
t: teleport color on/off \n \
l: show links on/off \n \
c: map color on/off \n \
f: flipped keys mode on/off \n \
z: show/ hide zones \n \
e: show/ hide entry window \n \
v: show/ hide list view window \n \
n: Next Object \n \
b: Previous Object \n \
number keys (+/-): With extras compiled\n \
in will run the Mass shifter\n \
\n \
Enjoy and have fun!
Enigma
Private First Class
Private First Class
Posts: 212
Joined: Sat Apr 23, 2005 3:13 am

Post by Enigma »

That is the biggest "else if" statement I have ever seen. Maybe you could use the strategy pattern here, or at least use a map. With a map, that whole block would simply be "g->s = someMap[str];." And the code "g->s" could use some more descriptive names. I apologize if I'm just picking at your code and not paying attention to the editor. It's just that I took a good programming class this semester, and now I'm very anal about these things.
User avatar
joevano
General
General
Posts: 1863
Joined: Sat Jun 18, 2005 1:08 pm
Location: South Bend, Indiana, USA

Post by joevano »

FYI the programing language you are using is C# not #C. I have seen you call it #C many times, and that just is not it. It's all in the details and it seems you have a hard time paying attention to them. Also, as always, I will recommend you use a spell checker. Heck, just use Firefox and it is built right in...
There is nothing worse than aggressive stupidity. -- Johann Wolfgang von Goethe
"How many legs does a dog have if you call his tail a leg? Four. Calling a tail a leg doesn't make it a leg." -- Abraham Lincoln
User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5196
Joined: Fri Dec 13, 2002 4:11 am

Post by JeffM »

he's actually using C++, not C#, you can tell by the -> pointer notation.

good job including all your svn info in there too.
ImageJeffM
User avatar
blast
General
General
Posts: 4933
Joined: Fri Mar 21, 2003 3:49 pm
Location: playing.cxx
Contact:

Post by blast »

Is this supposed to actually work? At version 2.2, I'd expect it to be somewhat functional. So far, it crashes instantly when I try to open a file. Even tried with a basic map that only had a single box. Same thing, boom, crash.

You forgot to comment out a line so that it will build on Windows.

Code: Select all

#include <unistd.h> // this is onily here so i can debug phraser
//errors --- I need it for the function sleep();
// in releases this will be comented out to allow for multi os support
I think you also should start running your code through a spell check. Try using "only", "parser", and "commented".

I'm also assuming it's not supposed to look this horrible:
Attachments
GtkBzedit.jpg
Eww
(89.58 KiB) Downloaded 59 times
"In addition to knowing the secrets of the Universe, I can assure you that I am also quite potty trained." -Koenma (Yu Yu Hakusho)

Image
User avatar
blast
General
General
Posts: 4933
Joined: Fri Mar 21, 2003 3:49 pm
Location: playing.cxx
Contact:

Post by blast »

Here's a Windows build for anyone that interested in this..... not that it seems to do much.

http://static.bzexcess.com/gtkbzedit_2.2_win32.zip
"In addition to knowing the secrets of the Universe, I can assure you that I am also quite potty trained." -Koenma (Yu Yu Hakusho)

Image
User avatar
fluffy mcduff
Private First Class
Private First Class
Posts: 68
Joined: Sun Mar 09, 2008 9:39 pm
Location: in my mind, slowly going insane.

Post by fluffy mcduff »

since c++ is a universal language, could it work on a mac?
User avatar
joevano
General
General
Posts: 1863
Joined: Sat Jun 18, 2005 1:08 pm
Location: South Bend, Indiana, USA

Post by joevano »

I guess you could say C++ is universal in that there are compilers for C++ for many different systems. That does not make C++ code portable across systems. The programmer usually must be aware of difference in the way different OSes implement different systems. That being said, nn used the Gtk approach so that it would/could be cross-platform, as Gtk has been implemented for Linux, Windows and OSx.
There is nothing worse than aggressive stupidity. -- Johann Wolfgang von Goethe
"How many legs does a dog have if you call his tail a leg? Four. Calling a tail a leg doesn't make it a leg." -- Abraham Lincoln
jpenguin
Private First Class
Private First Class
Posts: 128
Joined: Wed Jun 11, 2008 11:56 pm

Post by jpenguin »

fluffy mcduff wrote:since c++ is a universal language, could it work on a mac?
I replaced all occurrences of"usr" with "opt/local". Install all depends with macports, and got this--

src/main.cpp: In function 'int parse(FILE*)':
src/main.cpp:616: error: 'strndup' was not declared in this scope
src/main.cpp:718: error: 'strndup' was not declared in this scope
src/main.cpp: In function 'char* readstring(FILE*)':
src/main.cpp:768: error: 'strndup' was not declared in this scope
jpenguin
Private First Class
Private First Class
Posts: 128
Joined: Wed Jun 11, 2008 11:56 pm

How to build on a Mac

Post by jpenguin »

I got it to build on a mac us gtk-quart. It uses only frameworks, no unix style libs.

• Download the GTK Mac package http://www.gtk-osx.org/

• Get a Freetype framework http://prdownloads.sourceforge.net/cray ... p?download and put it in /library/frameworks/

• Download my build-mac.sh file and place it in your gtkbzedit folder

• open terminal

• type "cd "

• drag your gtkbzedit-read-only folder into the terminal window

• hit return

• Type "./build-mac.sh"

• hit return
Attachments
build-mac.sh.tar.gz
(304 Bytes) Downloaded 192 times
Picture 19.jpg
(126.33 KiB) Downloaded 26 times
User avatar
nn
Private First Class
Private First Class
Posts: 50
Joined: Mon Jun 11, 2007 10:47 pm
Location: PA
Contact:

Crashes and other bugs

Post by nn »

Hi,

The above release still had a bunch of kinks in it I have been testing loading many maps. Today and fixing the bugs as they appear.

My newest release has eliminated about 80% of crashes the program had before.

Eventually as i have time to get to it I will add a proper file open dialog and other needed features but for now I'm trying to fix other things as they came up.

One fault of the previous versions was links that looked like t67:f were ignored.

They are now read properly and at the same time when I fixed that I also fixed a common bug which Jammed the phaser when reading a teleport link.

Here is the newest Development Tar-ball

http://userbin.net/gtkbzedit_2.2_r1.tbz2[/url]
User avatar
joevano
General
General
Posts: 1863
Joined: Sat Jun 18, 2005 1:08 pm
Location: South Bend, Indiana, USA

Post by joevano »

Might I suggest some sort of development and testing plan. "Loading up many maps" will find some bugs, yes... but as far as finding all of the bugs, it will hardly come close. I suspect that your 80% of crashes fixed is one of the 96.7% of statistics that are made up on the spot.
There is nothing worse than aggressive stupidity. -- Johann Wolfgang von Goethe
"How many legs does a dog have if you call his tail a leg? Four. Calling a tail a leg doesn't make it a leg." -- Abraham Lincoln
jpenguin
Private First Class
Private First Class
Posts: 128
Joined: Wed Jun 11, 2008 11:56 pm

Post by jpenguin »

nn, I suggest that you put my mac script and instructions in your releases. Also, it m it be just mac, but when starting gtk bzedit

Code: Select all

(gtkbzedit:387): Gtk-WARNING **: gtk_scrolled_window_add(): cannot add non scrollable widget use gtk_scrolled_window_add_with_viewport() instead

And the main window doesn't catch keystrokes (except 'h') untill I select another window. This is probably because Mac-GTK is beta.


P.S.- Your going to add an open dialog, right?

P.S.2- Why did you use GTK, and not QT?

P.S.3- Do you plan to let userssee the map as it will appear in bzflag?
User avatar
blast
General
General
Posts: 4933
Joined: Fri Mar 21, 2003 3:49 pm
Location: playing.cxx
Contact:

Post by blast »

jpenguin wrote:P.S.- Your going to add an open dialog, right?
It has one, at least in Windows (and therefore, probably Linux). However, it tends to crash whenever I try to open up ANY map.
jpenguin wrote:P.S.3- Do you plan to let userssee the map as it will appear in bzflag?
I do not think that will be possible. I'm already doubting the scalability of his 3D display for even a wireframe view. He is not using OpenGL, so everything will be CPU limited. This means that you will not be seeing textures, lighting, etc. You might not even see filled in object faces. I imagine this would become extremely hard to view once a map becomes complicated. While this method has advantages (the target platform doesn't need to support OpenGL), it will severely limit the future of this editor.
"In addition to knowing the secrets of the Universe, I can assure you that I am also quite potty trained." -Koenma (Yu Yu Hakusho)

Image
User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5196
Joined: Fri Dec 13, 2002 4:11 am

Post by JeffM »

is there really a need to be able to edit maps on a system that is not capable of even playing the game?
ImageJeffM
Post Reply