Just checking that new posts can be made now.
After a long hiatus (what with getting a new job and all) I've managed to get a bit more done on this project. Today I started work on being able to select objects by clicking with the mouse. Currently it only works for sectors, and has some serious issues even for that limited scenario, but it's good to get something basic in place.
I was rummaging through my old projects and found this one from a couple of years ago. I've spent a couple of lunchtimes on it already and worked out a few kinks in the old cogs. Still a fair bit of work left on the cogs, and then there would need to be at least one level to actually implement it. Maybe when (if!) I get them working, we could have another Hub level contest?
Delete sector was implemented today, along with the framework for unlimited undo/redo. The undo/redo is not totally bug-free - for example undo the deletion of a sector adds it back at the end of the sector list, not where it was deleted from, so the sector number will change, but for a first pass it is good enough.
I've managed to get the "add sector" functionality added to JKW-JKL. "Delete sector" and "cleave sector" are the two next targets.
I've uploaded a proof of concept of the "restoring power" part of the level. When power is restored, the lights in the dark corridor will turn on with the "flicker" of fluorescent lights. It'll also enable the door at the start position to be opened. I'm looking for suggestions (or donations!) of a good sound for a switch without power. I thought a remembered a sound from JK that would do, but I couldn't identify it when browsing through the sounds in JED.
Started work today on writing a lexical analyser for cog scripts. This converts a stream of text into a stream of "tokens" (identifying portions of the text that are keywords, variable identifiers, operators, etc) that can be used for two main purposes:
1) a better syntax highlighter (current implementation is just... horrid)
2) as the first stage of a parser that will be able to produce a parse tree of the cog script - this allows for some of the more advanced features of an IDE.
I was going to put in a quick port to C# of Parsec as a triggerable function, but looking at the source code, it was probably going to take me as long to port as it would be to do it the way I ultimately wanted to do it :)
I finally got around to fixing the code that handles mouse clicks. Now when you click on the text to set the cursor position, it correctly takes into account any tab characters on the line.
This will also be needed for text selection which I've begun work on (as the first step towards copy and paste functionality).
I haven't worked on this for a while - Real Life(TM) got in the way.
I've fixed a few of the niggles in the text editor. There are plenty more to finish off, but I thought I'd let you guys get your hands on a very early build. It's just cog editing at the moment though.
Head over to the Downloads page to grab a copy.
Since my last update, I've moved quite a way forward. I have released v0.1 of JKW to a couple of people who were bugging me to see it. Still very much in its infancy, you could only work with cog files. It had a basic text editing interface and a working, albeit slightly buggy, syntax highlighter. Since then I've pulled the Level Editor component into the new application architecture (which I won't go into here - ask me if you're interested) and exposed that functinoality again. I'll then work on establishing the idea of a collection of documents making up a project (again, this is a document, so could you have a project that contains, among other documents, another project? I'm saying no, unless someone can come up with a compelling argument for writing a lot of code to prevent circular references turning into stack overflows).
Just solved a rather annoying problem I was having with the basic text interface. I've been fiddling with this for a couple of weeks now, and it was holding up pretty much all progress I was making. The problem was that the scrollbars were being a bit over-reactive, and scrolling the document when I only wanted to move the caret around. I tried various methods to kill off this feature, even resorting to inheriting from the scroll bar control and trying to override any code that was dealing with keyboard input. Whilst this didn't actually work (the scroll bar stilled scrolled), it did - with a large dosing of help from a colleague - lead me to finding the actual cause of the problem as being that the painter control that was drawing the text to screen was passing focus away from itself by not recognising the arrow keys as input. I should now be able to fix the bug in a nicely elegant way by handling the PreviewKeyDown event on all the child controls.
Okay, I've not done much for the last week or two. I've had a mare of a week at work and then got myself a nasty cold which I'm only just shaking off. However, I'm picking this back up. What I'm working towards at the moment is releasing an alpha version of a stand-alone JKW-Cog. This will probably be a SDI (not the lovely MDI goodness I've been posting screenies of) and will really only feature syntax highlighting.
What's needed before then is tidying up, really. There are several features of a text editor that aren't currently finished - such as clicking the mouse on the screen and moving the cursor to the position underneath. Also, I never quite got around to writing the Save File code. But hey, who uses that feature, right?
I've been making steady progress with the text editor within JKW. The cursor needs a slight rework so that it can be specified in terms of line number and column within line, rather than the current method of offset in the text buffer. This is necessary now that I've got the line handling routines in place that will display multiple line files correctly. The other thing I've recently completed is the first draft of file loading. At the moment it is tied directly into the Cog class, but will move into the "document" interface (this covers not just text documents, but levels, 3dos, etc as well) and use a strategy to allow the different document types to have their own specialised code.
Decided to take a break from level editing functionality to get the ball rolling on cog editing. Whilst it might not look like more than just a text box on a form at the moment, it's actually a view on to a text buffer that is held separately in memory as an object in its own right. This will make it much easier to implement things like syntax highlighting and code completion.
Finally something interesting to post. After correcting all the bugs in the code to handle mouse position, I finally got around to working on the cleave command. At the moment it can calculate where the new edges will be, and previews that in the level editor as you drag out the cleave.
Next I will work on splitting the sector along that plane.
So, I figured today that refactoring the basic objects I'm using to store information about the 3D space would be useful. I'm adding a "Line" object represented by a point and a vector as the maths dictates it should, rather than letting a "position" (point + orientation) stand in because it was already written.
The code for working out what part of the grid was underneath your cursor has a bug and the old code for handling lines made it a huge mess of trigonometric functions to wade through to figure out where I'd messed up. The new code will be nice and simple vector arithmetic, which should speed up the bug hunt.
Summary: Cleave still isn't finished.
Just a quick progress update to let everyone know I haven't forgotten about this project.
I've been spending a while working to get the first editing command working: Cleave. I've needed to write a lot of code that will be common to all editing operations, so subsequent commands will hopefully materialise quicker.
Right now, I'm immersed in the middle of a refactoring of the code to handle the grid - necessary for converting the window co-ordinates of the mouse into the grid co-ordinates of the point "underneath" the mouse.
Once that is out of the way, I have two major tasks left on Cleave: firstly, visualising the cleave whilst dragging the mouse; secondly, actually cleaving the sector.
Refactored the camera code to be handled by its own class. I implemented some rudimentary mouse control into the camera - hold down the right mouse button and you can spin the level around.
Had a moment of panic when the memory stick that is currently holding the only copy of the source code decided to pretend to be dead. I have already contacted the guy I was begging access to a source repository from, to see where he's at with getting me access. I've also copied the latest source onto another computer.
Hammered out the architecture of updating the model and propogating events encapsulating that update to the views observing those models. That is: when you make a change to a level, you can see the change you made - not exactly overwhelming when put in those terms ;)
I'll next take a small diversion into saving/loading projects, so that I can start building a level in this thing to see where features are needed or the interface is klunky.
Project Explorer - base code laid down for this section. Handles levels only at this point (but then, levels are the only thing you can create within a project at the moment as well)
Level Editor - possible to have several views of a level open at once. Changes to level made in one window propogate to all windows. Viewpoint and grid are specific to the window and can be altered independently.
Next part to work on will be general level editing.
Not much done this evening. Refactored the rendering code so the camera is movable, although it is still fixed in the direction it is looking at. Added the main window, so Level Design windows are now MDI child forms.
I've started writing a bit of code for JKWorkshop. I can render a wireframe of a level to an editor control. Plenty of work left to go, as the level itself (the good ol' default cube from JED makes a comeback), the viewing angle/position are all hardcoded, and the functinos for actually editing has not even been started.
Barring any delays to the closing date for submission, this level won't be entered for the Hub CTF Pack, since it is too far from finished. I tried to work quickly enough to submit an unpolished level but it just didn't happen.
I'll take a couple more weeks over finishing this and hopefully do the concept justice.
With only one more lunchtime left to work on this before the CTF Contest deadline, I've uploaded yet ANOTHER alpha version (I really should be on to betas by now. Ah well.)
Textures half done. Yes, I know the ones that are placed are ugly. :(
No weapons placed yet.
Lighting not started yet.
Feedback still appreciated, even at this late stage.
Hooked up lower corridor to new base layout.
Spent some time creating a dome for the central area as well.
Still need to add in support/defense structs in base and make the central area a "bottomless" (fade to black) pit.
I've uploaded the latest version. The red base has been updated with a new design. This will be copied over to the gold base (and blue and green bases if converted to CTF Plus, of course) in a later version.
I'd love some feedback on the new design. I'm planning to put in support pillars for the floating platform that will do a similar job of providing cover for defenders as the ones in the gold base.
Changing it once again. The flag you are carrying will be stored in the red flag's normal bin. Since you can only carry one at a time, it's a simple case of holding the team number of the flag you are carrying.
Likewise with the keys, except it will be a bitwise combination of 2^(team number - 1), i.e. red = 1, gold = 2, blue = 4, green = 8.
However, now the bins appear to have a maximum value of zero. Which means I would need a modified items.dat anyway, which is what I was trying to avoid.
After a week or so not looking at this level to pursue some other experiments with JK, I've returned to this and started refining the architecture in the base.
Today was spent making nice stairs.
A new HOM portal Proof of Concept has been uploaded. I've been working on this for a couple of days, and ironed out a load of bugs. There's still some in there, including some problem with colliding with the actor placed in the opposite corridor. I believe this can be fixed through using a new template, but that is investigation for another day. Check it out and give me some feedback in the forum, please!
I've uploaded a demo of HOM being used to do "split screen". It's a slightly different application of that being described in this thread on Massassi. It's supposed to be a seamless portal effect, in that you can see through an area into a different area, but that second area is supposed to look like it is actually beyond the surface, not that you are looking at somewhere else. Did that make sense?
There are still problems with it. Getting the player's true Lvec isn't working correctly, so I'm settling for simply grabbing the Lvec of the player thing. This means the alternate actor doesn't look up or down. Another problem is that the model of the player doesn't get picked up by the actor, so in external view the character flickers between whatever player character and the kyle model. In internal the gun isn't redrawn on the actor screen so can flicker. To save from removing the actor thing when the effect is turned off whilst still in the actor view, the turn off code has a sleep in it that can pause the game momentarily.
Other bugs abound I'm sure, but it's another small step towards perfecting this technique. I think most of that is due to the problem suiting the application much more than most that other people have tried. Feedback welcome of course.
Uploaded a demo of using invalid reverse adjoins.
This came out of a discussion with Emon, and basically uses overlapping sectors to create a tunnel through a room. From the room, the tunnel doesn't appear, but the tunnel is adjoined to the room.
It's just a proof of concept, and I don't know how it'll work with more than one player around, but if anyone wants me to explain more what's going on, then drop me a note.
After a couple of days struggling, I finally got the CTF cogs to work. I've now just got to re-add all the non-CTF things that I removed from the level in trying to get it to work!
Thanks to PhantomCoder finding spare bins, I went back and added in support for team keys in CTF Plus.
It's not finished yet, I still need to generate the cogs for specific blue and green keys, but the main cog has been updated to handle them.
As an additional benefit, the blue and green flag bins no longer overwrite the red/gold CTF keys from standard CTF, so it will be possible to put standard CTF and CTF Plus levels in the same episode. Blue and Green flags and keys overwrite the Red/Yellow/Blue/Green keys from single player, which hopefully no mods are overwriting.
Thanks to Zeq's help, I got the Power Node class cog working today. You can capture and destroy nodes now. There is still a lot of refinement to happen, but the basic functionality of individual nodes is now working.
Next thing I will be working on is the ons_main.cog for controlling the node network.
Had trouble working with class cogs today. I was trying to get the Nodes to handle switching by themselves, but couldn't get the class cog to receive any messages. Hopefully I can get this sorted, because it will simplify implementation in levels quite drastically.
Worked today on setting up certain mechanisms within class cogs. This will make it easier to implement Onslaught into levels, as you'll only need to add in templates for the various nodes and then place the nodes within the map. Still haven't come up with the best way to define the node links.
In clarifying certain rules of the game, I did find I'd been calling various things by the wrong names. FROM NOW ON, what I have been calling a Power Node is called a Power Core and what I have been calling a Node or a Link Node is called a Power Node.
Nodes initialising correctly now. Team switching for debug purposes implemented.
However, node control wasn't working. Now realised it is because I was looking at the wrong parameter of the message :$ That will be fixed tomorrow. If all goes well, code should be fixed up enough for a release of Proof of Concept code by end of this week/early next week.
I've spent a short while knocking up a very rough Proof of Concept. So rough in fact, that it doesn't work yet...
When I do have it working, it will require tweaking to handle syncing issues correctly. I will release a demo level demonstrating this Proof of Concept when it is actually working properly.
I expect there will be a call for level makers to create levels to release an "Onslaught Level Pack" much like there was for JKArena.
Image of Glory posting will now not insert escaped strings into the database.
Problem was caused by failure to check if magic quotes was enabled and removing escaping if it was before further processing.
Okay, I've got it sort of working. There's an issue still with whether you're allowed to see the page, and the database updates aren't hooked in to the page yet, but it's getting there.