[FTEQW][WIP] CraFTEr - realtime game editor for FTE

The home for dedicated threads to specific projects, be they mods, tools, or independent games.

Moderator: InsideQC Admins

Re: [FTEQW][WIP] Crafter - realtime game editor for FTE

Postby toneddu2000 » Fri Aug 11, 2017 2:45 pm

CraFTEr v0.1
Project download link (without executables, download the one for your OS here)
Code only download link

CraFTEr editor by Antonio "toneddu2000" Latronico
All code(with the GREAT help of Spike), models, textures and sounds created by me and released under Public Domain

CraFTEr *should* be a realtime game editor, but, right now is not even a working level editor. Too many
features missing or not fully working and too little time to dedicate.
This is a completely rewrite from the one shown in this video, so, it's pretty basics

none, really. If Spike it's okay with the code I stole from him(rotating pivot and bsp texturing stuff), let's just say it's all under Public Domain. Otherwise, please let me know and I'll release those parts under a license of his choice (those parts are already credited using "By Spike" in commes).

E -> move mode. Move objects on the XY space. Use Shift / Ctrl to raise / lower placement grid and place objects on Z axis.
F -> play / editor mode. Switch between editor and play mode.
G -> group mode. Select 2 or more objects and then press G. A blue icosphere will appear on the center. Ungroup is not implemented yet(!!)
L -> Linking panel. ESC to clear.
M -> Layers panel. M again to clear.
N -> Naming panel. ESC to clear.
Ctrl + O -> Level open. Type level name to open and then press Enter.
P -> Properties panel. ESC to clear.
Q -> selection mode. Selection is Blender-Like: select one element, then select another to do multi-selection. ESC will clear selection.
Shift + Q -> Select by type panel. ESC to clear.
R -> rotate mode. Rotate objects on Y axis. Really? Only Y axis?? Yes. But..? Yes. Mghgh.. Yes.
Shift + S -> rendering shading toggle. It activates / deactivates realtime shading on ONLY models that have a rtlights shader applied.
Ctrl + S -> Save level. Type level name to save and then press Enter.
T -> mesh place mode. Click the 3d area where to place mesh and Mesh Preview panel will appear (see Mesh Panel for further istructions).
Y -> entity place mode. Press Y to cycle trough entity types(player, enemy, light, sound, door, trigger). Once click on ground Entity panel will appear (Entity panel for istr).

Right click -> enable / disable cursor.
Mouse wheel -> with cursor enabled it will raise / lower snap grid size, with cursor disabled it will increase / decrease camera speed.

Mesh preview: pagUp pagDown to change category folders(gothic,industrial,etc.), arrow up/down to change type folders(walls,doors,beams,etc.), arrow left right to scroll models
Select by type: arrows to scroll type selection and Enter to filter selected type
Layers: Arrows to go up/down, space to add to layer, Enter to rename layer(not implemented yet)
Logic: Not used right now.
Naming entity: type name and press Enter to apply.
Linking entity: Select FIRST entity (light, AI, etc.) and then Trigger entity before press L key. A red wire displays connection.
Properties: entity-based properties panel. Up / down arrows to go up/down the list, property with <<>> uses left/right arrows to modify property, property with * uses spacebar to toggle on/off

I didn't have the time to implement correctly entity types, so they're just useless placeholders. Sorry. There are 6 of them: Player, Enemy, Light, Sound, Door, Trigger.
Player: right now, it does nothing. So, yup, no use at all. it should be used to place player respawn entity in map.
Enemy: this should trigger logic behaviours choice panel and AI/waypoint stuff (patrol,flee, etc) but, right now, is empty.
Light: probably the most complete. It creates a dynamic light with RGB color selector, radius, and shadows toggle.
Sound: ugh..I'm not even sure if I understood how sounds work in FTE. Imagine if I can write a panel to handle them..
Door: placeholder function. Not even sure what to put inside.
Trigger: I had big plans on this but, right now is just an entity (the ONLY entity) which can be linked to another entity like light or sound or whatever.

**CUI (Crafter User Interface)**:
CUI is an experimental component for Crafter. It allows devs to create UI widgets like texts, buttons, lists, windows in no time.
It still lacks lots of features but it's quite usable. It handles 2D input trigger conpletely.

To use it in a blank project (in CraFTEr it's ready to use):

1) copy all the cui defs in defscustom.c in your defs file
2) Place CUI_TriggerButton1Released(); in your input mouse released func.
3) In CSQC_UpdateView call something like

void CSQC_UpdateView(float vwidth, float vheight, float notmenu)

Parameter of CUI_Visualize is visibility context, of course UI_VIS_BLAH and UI_VIS_FOO are const float like
const float UI_VIS_ALWAYS = 0;
const float UI_VIS_BLAH = 1;
const float UI_VIS_FOO = 2;
and so on. Of course, all cui objects with context visibility set to UI_VIS_ALWAYS will be always visible
(because outside of any condition block), no matter which condition is enabled.
This could be useful for hud elements, for example, or for any 2d element you want to be always visible.
Instead elements with context visible set to UI_VIS_BLAH for example will be visible only when blah condition
is met. That could be a menu entry triggered by a button for example.

4) define in your defs some ui elem entity, for example:

entity root,screen,winprop;

then in your CSQC_Init() add something like

root = CUI_Window(uiElRoot,[1920,1080,0],[0,0,0],[0,0,0],0,UI_VIS_NULL);
screen = CUI_Window(root,[800,600,0],[0,0,0],[0,0,o],0,UI_VIS_NULL);
winprop = CUI_Window(screen,[320,200,0],[100,80,0],[1,0,0],0,UI_VIS_PROPMESH);

These are CUI widget spawn function(CUI_List is still unusable right now):
entity CUI_Window(entity parent, vector dim, vector coord,vector bgcol,float a, float vis)
entity CUI_Button(entity parent, float typebut, vector coord,void() onrelease,string lbl, float vis)
entity CUI_List(entity parent, vector dim, vector coord,vector bgcol,float a,string s_ar,string butoklbl,void() okrelease,void() cancelrelease,float vis)
It's still missing a lot, but at least I should implement:
toggle checkbox, labels, and dropdown list

**TECHNOLOGIES(with corresponding source file names)**:
ED -> editor functions to manipulate and visualize objects in realtime. Probably useful for something useless
BSP -> create BSP boxes on realtime. There's still A LOT to do (for example it only support cubes, not boxes) but whatever
INPUT -> probably my favourite one. Nothing fancy, but just a very tidy way to put all your input events and a nice way to trigger them.
CUI -> simple UI widget creation (a GUI for creating ui elems would be cool).
RENDER -> pretty cool functions to draw 3d figures in realtime without the need of real 3d models. Probably worth a peek inside.
PHYSICS -> nothing here, pretty basic and useless. If (unlike me) GPL doesn't disgust you, copy ... n/pmove.qc in your project as a pretty stable base

**MISSING FEATURES(oh boy..)**:
1)Ungroup -> really.. you can group entities but you can't ungroup
2)Duplicate -> first version of crafter implemented it but since this is a completely rewrite, I need to understand how many fields I need to duplicate
3)Scale objects -> what the..
4)Logic -> yeah, I tried many times to create a logic system which should permit devs to just select a behaviour and voilà, but, honestly it's quite far from usefulness.
5)Physics -> CraFTEr (and FTE) desperately needs a brand new physics system with qc ragdolls, collision detection (even with separated collision models would be ok) and entity on entity reactions (like a crane moving a physics box, for example).
6)Animation panel -> an animation panel where see animations and link animation events to iqm models (yeah in FTE it's possible) would be cool.
7)Story editor -> it would be pretty neat to have a dedicated window where to put all story-related triggers and cut scenes actions.
8 )Map size selector -> this is easy.. I should add at start a menu where to select one of the empty hull bsp maps.

**KNOWN BUGS (oh my..)**:
1)If you try to place light near to 3d models, apparently lights don't affect my models but it's just a shader matter. In fact I'm trying to mix rtlights shader with the addition of vertex colors, which are very cool. If you want to see realtime lights shader, replace in every model program ton_vtcolor with program spike_rtlight. It won't see vertex colors but at least it will use realtime lights!
2)Sometimes, select by type panel could visualize group icons even in map with no grouped elements.
3)On older computers origin tripod icon seems not to follow mouse, placing objects where it wants not where YOU want. Try set vid_with to 800 vid_height to 600 and vid_fullscreen_standalone to 0 in default.cfg, restart and see if it works again. In this case, not my fault.
4)Sometimes it could be quite difficult to select entity types different from static models (lights, sound).

Hope you have fun using it or forking it
Posts: 1154
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy

Re: [FTEQW][WIP] CraFTEr - realtime game editor for FTE

Postby Julius » Mon Aug 21, 2017 12:33 pm

Sorry for pestering, I just think that it is better to develop openly and release early and often.

@Spike: could you please clarify the license? Always better to have a clear picture on that and "public domain" is not a legal concept in many countries. Would CC0 ( ) for the assets and MIT or BSD (GPL?) be OK for the code?
Posts: 82
Joined: Sun Aug 29, 2010 4:32 pm


Return to Project Showcase

Who is online

Users browsing this forum: No registered users and 2 guests