Sonic and Sega Retro Message Board: Programming a level editor - Sonic and Sega Retro Message Board

Jump to content

Hey there, Guest!  (Log In · Register) Help
  • 2 Pages +
  • 1
  • 2
    Locked
    Locked Forum

Programming a level editor In theory

#16 User is offline Kroc 

Posted 26 February 2014 - 08:43 AM

  • Code is Art
  • Posts: 37
  • Joined: 27-May 13
  • Gender:Not Telling
  • Project:MaSS1VE: The Master System Sonic 1 Visual Editor
Yes, but with scrolling!?? My first was something like 20'000 image controls on one form, moving every one for every scroll!
Nowadays I API render just the necessary portions. If you're still using VB6 then check out the source code for MaSS1VE, there's plenty of cool technology there.

#17 User is offline Travelsonic 

Posted 26 February 2014 - 01:31 PM

  • Posts: 725
  • Joined: 01-March 05

View PostBlack Squirrel, on 13 February 2014 - 12:19 PM, said:

C++ is not ideal for level editors - it generally involves extra work for very little gain.


Wait, what do you mean by this perchance?

#18 User is offline Glitch 

Posted 26 February 2014 - 03:07 PM

  • Posts: 158
  • Joined: 22-September 08
  • Gender:Male
  • Project:Sonic 2 LD
  • Wiki edits:22
IMO, if you're using a framework like Qt then writing an editor in C++ can be just as quick as throwing together a Swing or WinForms app. It's been a long time since we've had to dig into the bowels of win32 controls directly.

#19 User is offline KingofHarts 

Posted 10 March 2014 - 03:07 PM

  • Posts: 1610
  • Joined: 07-August 10
  • Gender:Male
  • Project:Project Sonic 8x16
  • Wiki edits:1
Giving my own two cents on the matter Elektro-Omega, I myself am programming a multi-facet editor as well, much like what you are goin on about. That said, I'm using GML, with which I have over 10 years of experience... I've little experience in other languages, and can't really say much to that effect.

For palette editing/limited colors, a simple 1D array of 16 entries will usually suffice. Should you want use of multiple lines of entries, have an array of multiples of 16, and the equation x div 16 will determine the line that the entry is in, with x mod 16 being the entry # within that individual line.

For art editing, I use a 2D array to contain the bit data in the art files, and draw the tiles onto surfaces from there. The way I do it is probably rather primitive compared to what could be done... and I'm working on improving it... that said, I can do real time color changing and palette cycling so it's only a slight pain when loading large tilesets, and a benefit for the most part, otherwise.

These are just examples of what I am doing, but all in all, back to your goal... if you want to build an editor to learn/improve a language... I suggest start VERY basic, and make a tool for editing Sonic palettes, or something similar of the sort. That's how I started Triad, and it's only grown from there over the past 2 years.
This post has been edited by KingofHarts: 10 March 2014 - 03:08 PM

#20 User is offline Billy 

Posted 10 March 2014 - 04:59 PM

  • RIP Oderus Urungus
  • Posts: 1817
  • Joined: 24-June 05
  • Gender:Male
  • Location:Colorado, USA
  • Project:retrooftheweek.net - Give it a visit and tell me what you think!
  • Wiki edits:15

View PostTravelsonic, on 26 February 2014 - 01:31 PM, said:

Wait, what do you mean by this perchance?

I can't speak for him, but I can offer my personal experience. At least when making Windows applications with a GUI, C# is much more suited to Windows forms than C++ is. Just because of how the language is structured. Its difficult to explain, but C# allows for much more direct and easier control of a form. Though, I know nothing of GUI programming in linux.

#21 User is offline Travelsonic 

Posted 10 March 2014 - 07:00 PM

  • Posts: 725
  • Joined: 01-March 05

View PostBilly, on 10 March 2014 - 04:59 PM, said:

View PostTravelsonic, on 26 February 2014 - 01:31 PM, said:

Wait, what do you mean by this perchance?

I can't speak for him, but I can offer my personal experience. At least when making Windows applications with a GUI, C# is much more suited to Windows forms than C++ is. Just because of how the language is structured. Its difficult to explain, but C# allows for much more direct and easier control of a form. Though, I know nothing of GUI programming in linux.


Direct/easier in which ways?

EDIT: I feel weird asking, majoring in computer science, and programming in a variety of languages - some GUI programming, some not... just feel like the answers I am getting are vague.
This post has been edited by Travelsonic: 10 March 2014 - 07:03 PM

#22 User is offline flamewing 

Posted 10 March 2014 - 07:34 PM

  • Emerald Hunter
  • Posts: 1138
  • Joined: 11-October 10
  • Gender:Male
  • Location:🇫🇷 France
  • Project:Sonic Classic Heroes; Sonic 2 Special Stage Editor; Sonic 3&K Heroes (on hold)
  • Wiki edits:12
If you want a good chance of making your editor Windows-only, then go ahead and use C# and Windows Forms freely. Windows Forms are unlikely to be 100% supported in Mono (it supports up to WinForms 2.0, and not 100% support either) because it can be dangerous to make better support for it: it is one of the components that is not in Microsoft's (largely meaningless) community pledge.

If you don't want to use C#, you can use wxWidgets or Qt with C++, all of which have good cross-platform support. There are some C++ wrappers for Gtk+ which allow it to be used with C++ without having to descent into C syntax in the middle of your code; Gtk-- is one I used in the past.

If you want to use C#, you can check wxNet (wxWidgets wrapper), Gtk# (Gtk+ wrapper) or Qyoto (Qt wrapper). Be aware that, depending on which .Net assemblies you use, you can still lose cross-platform support; the safest way to guarantee it would be to develop it in a Linux box and cut anything that causes the program not to run.

#23 User is offline Billy 

Posted 11 March 2014 - 01:18 PM

  • RIP Oderus Urungus
  • Posts: 1817
  • Joined: 24-June 05
  • Gender:Male
  • Location:Colorado, USA
  • Project:retrooftheweek.net - Give it a visit and tell me what you think!
  • Wiki edits:15

View PostTravelsonic, on 10 March 2014 - 07:00 PM, said:

Direct/easier in which ways?

Okay so I'm not very good at explaining, so I googled it. People seem to explain it just fine in this stackoverflow question. Again, this is really winforms only, as people here and online seem to have no problem using C++ with other GUI solutions.

#24 User is offline Cooljerk 

Posted 31 March 2014 - 12:44 PM

  • NotEqual Tech, Inc - VR & Game Dev
  • Posts: 4198
  • Joined: 06-April 06
  • Gender:Male
  • Wiki edits:9
Reminder - 2d arrays in c++ aren't arrays of arrays. They are one array, stored in sequence in memory. This is different than java where a 2d array is an array of pointers to arrays.

I[w*y+x] is a 2d array in cpp where w is the width of your 2d array. Assuming a 2x2 array, where w is 2-1 (to keep in boundry), I[w*1+1] is functionally equivalent to I[1][1].

This can be handy when managing references.

Don't let people in this topic dissuade you, I did just this back inlike 2008, it's a terrific learning experience.

Edit: people talking about gui apps cross platform - just build your gui yourself. I used sdl and designed a portable gui that was created as an object. Really, provided access to a framebuffer, you're good to go if you want to go real low level. Sdl 2.0 includes a number of improvements that'll make building an editor gui much simpler. When I built mine, I couldn't even create multiple windows!
This post has been edited by Cooljerk: 31 March 2014 - 12:51 PM

#25 User is offline winterhell 

Posted 31 March 2014 - 01:34 PM

  • Posts: 1157
  • Joined: 16-October 10
  • Gender:Male
One shouldn't even think about multiplatform support on their first product.
As for the custom GUI, I'm all for it. On the low level for that you only need to be able to render a texture and capture the mouse input. It might sound tempting to use the GUI the development environment offers, but you never know if that would work on different systems if that is a concern.

#26 User is offline Cooljerk 

Posted 31 March 2014 - 01:39 PM

  • NotEqual Tech, Inc - VR & Game Dev
  • Posts: 4198
  • Joined: 06-April 06
  • Gender:Male
  • Wiki edits:9
On your first project, no, you shouldn't be about multiplatform support. But if you have experience to build a cross platform product, you need to begin designing for cross platform support at the very beginning. And I don't mean cross platform like x86 Linux and x86 Windows. Learn to love to abstract and use the shit out of malloc, lol.

Speaking of which, you can design a multidimensional array that behaves like java using malloc. I prefer cpp 2d arrays, though, unless I need an uneven array.

Edit: I actually built my gui as I built my 2d engine. My gui was literally made from my 2d engine and built by the tools I made. That made them all intimately connected. Building the gui built my tools, and building my tools built my gui. Really good learning exercise.
This post has been edited by Cooljerk: 31 March 2014 - 01:47 PM

#27 User is offline TmEE 

Posted 31 March 2014 - 03:44 PM

  • Master of OPL3-SA2/3
  • Posts: 1726
  • Joined: 06-January 08
  • Gender:Male
  • Location:Estonia, Rapla City
  • Project:T-04YBSC-A !
  • Wiki edits:11
I have made a serious music tool for windows, and I don't yet know how to make a single menu or button in windows.... I made my own GUI setup haha.

#28 User is offline Cooljerk 

Posted 31 March 2014 - 04:05 PM

  • NotEqual Tech, Inc - VR & Game Dev
  • Posts: 4198
  • Joined: 06-April 06
  • Gender:Male
  • Wiki edits:9

View PostTmEE, on 31 March 2014 - 03:44 PM, said:

I have made a serious music tool for windows, and I don't yet know how to make a single menu or button in windows.... I made my own GUI setup haha.


I've worked for a number of companies doing UI/UX design... never once worked with the windows UI haha. It's like a 4-letter word, it seems.

  • 2 Pages +
  • 1
  • 2
    Locked
    Locked Forum

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users