[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: code swarm video



On Wednesday 13 May 2009, Frans Pop wrote:
> On Wednesday 13 May 2009, Frans Pop wrote:
> > Request: think you could do the same for d-cd sometime?
>
> Or maybe better: share the HOWTO of installing the software and making
> the video + any config/scripts you used?

Turns out that it's fairly simple. The documentation on the code swarm 
wiki [1] is fairly good.

- Install packages ant and sun-java6-jdk (no recommends required)
- Make sure the sun jdk is actually used:
  sudo update-java-alternatives -s java-6-sun
- Get code swarm source:
  $ svn checkout http://codeswarm.googlecode.com/svn/trunk/ codeswarm
  or, if you prefer:
  $ git svn clone http://codeswarm.googlecode.com/svn -T trunk
  $ git gc; git svn show-ignore >> .git/info/exclude
- Build it by running 'ant'
- Get and convert the D-I SVN history as documented on [2]
- Run code swarm with the resulting XML file: ./run.sh ./data/d-i.xml
  the frames will be shown while they are built; some options are
  available (type "?" for help)
- If you want, create the video (see [2]); probably the most complex step;
  debian-multimedia archive is almost a requirement

Attached both Joey's config and my latest config (which has the 
alternative categorization I mentioned yesterday; colors may need some 
more thought) and the awk script I used to strip down the SVN log.

Here's a hack that somewhat mitigates the bug Joey reported [3]; I only 
get the "files are tiny dots and too dark" variant:
--- a/src/code_swarm.java
+++ b/src/code_swarm.java
@@ -1476,7 +1476,7 @@ public class code_swarm extends PApplet {
     public void drawFuzzy() {
       tint(nodeHue, life);

-      float w = 8 + (sqrt(touches) * 4);
+      float w = 12 + (sqrt(touches) * 10);
       // not used float dubw = w * 2;
       float halfw = w / 2;
       if (life >= minBold) {

[1] http://code.google.com/p/codeswarm/w/list
[2] http://code.google.com/p/codeswarm/wiki/GeneratingAVideo
[3] http://code.google.com/p/codeswarm/issues/detail?id=61
# This is a sample configuration file for code_swarm

# Frame width
Width=640

# Frame height
Height=480

# Input file
InputFile=convert_logs/activity.xml

# Particle sprite file
ParticleSpriteFile=src/particle.png

#Font Settings
Font=SansSerif
FontSize=10
BoldFontSize=14

# Project time per frame
#MillisecondsPerFrame=21600000
MillisecondsPerFrame=43200000

# Maximum number of Background processes
MaxThreads=4

# Optional Method instead of MillisecondsPerFrame
#FramesPerDay=4

# Background in R,G,B
Background=0,0,0

# Color assignment rules
# Keep in order, do not skip numbers. Numbers start
# at 1.
# 
# Pattern:  "Label", "regex", R,G,B, R,G,B
# Label is optional.  If it is omitted, the regex
# will be used.
#
ColorAssign1="Changelogs",".*changelog", 145,44,238, 145,44,238
ColorAssign2="Docs","(.*\.txt|.*/README|.*/doc/.*|.*/manual/.*)", 0,238,238, 0,238,238
ColorAssign3="Templates",".*\.templates", 0,0,255, 0,0,255
ColorAssign4="Translations",".*\.po", 0,255,0, 0,255,0
ColorAssign5="Code","(.*\.sh|.*/debian/.*)", 255,255,0, 255,255,0
ColorAssign6="C Code","(.*\.c|.*\.h|.*\.cpp)", 255,0,0, 255,0,0

# Save each frame to an image?
TakeSnapshots=true

# Where to save each frame
SnapshotLocation=frames/code_swarm-#####.png

# Draw names (combinatory) :
# Draw sharp names?
DrawNamesSharp=true
# And draw a glow around names? (Runs slower)
DrawNamesHalos=false

# Draw files (combinatory) :
# Draw sharp files
DrawFilesSharp=false
# Draw fuzzy files
DrawFilesFuzzy=true
# Draw jelly files
DrawFilesJelly=false

# Show the Legend at start
ShowLegend=true

# Show the History at start
ShowHistory=true

# Show the Date at start
ShowDate=true

# Show edges between authors and files, mostly for debug purpose
ShowEdges=false

# Turn on Debug counts.
ShowDebug=false

# Natural distance of files to people
EdgeLength=25

# Amount of life to decrement
EdgeDecrement=-2
FileDecrement=-2
PersonDecrement=-1

#Speeds.
#Optional: NodeSpeed=7.0, If used, FileSpeed and PersonSpeed need not be set.
#
FileSpeed=7.0
PersonSpeed=2.0

#Masses
FileMass=1.0
PersonMass=10.0

# Life of an Edge
EdgeLife=250

# Life of a File
FileLife=150

# Life of a Person
PersonLife=255

# Highlight percent.
# This is the amount of time that the person or
# file will be highlighted.
HighlightPct=5

## Physics engine selection and configuration
# Directory physics engine config files reside in.
PhysicsEngineConfigDir=physics_engine
# Force calculation algorithms ("PhysicsEngineLegacy", "PhysicsEngineSimple"...) :
PhysicsEngineSelection=PhysicsEngineLegacy

# OpenGL is experimental. Use at your own risk.
UseOpenGL=false
# This is a sample configuration file for code_swarm

# Frame width
Width=800

# Frame height
Height=600

# Input file
InputFile=data/d-i.xml

# Particle sprite file
ParticleSpriteFile=src/particle.png

#Font Settings
Font=SansSerif
FontSize=10
BoldFontSize=14

# Project time per frame
#MillisecondsPerFrame=21600000
MillisecondsPerFrame=43200000

# Maximum number of Background processes
MaxThreads=4

# Optional Method instead of MillisecondsPerFrame
#FramesPerDay=4

# Background in R,G,B
Background=0,0,0

# Color assignment rules
# Keep in order, do not skip numbers. Numbers start
# at 1.
# 
# Pattern:  "Label", "regex", R,G,B, R,G,B
# Label is optional.  If it is omitted, the regex
# will be used.
#
ColorAssign1="Changelogs",".*/changelog", 145,44,238, 145,44,238
ColorAssign2="Manual",".*/manual/([^/]*|(en|debian|build|scripts|historic)/.*)", 0,255,0, 0,255,0
ColorAssign3="Manual: translations",".*/manual/.*", 0,140,0, 0,140,0
ColorAssign4="Documentation","(.*\.txt|.*/(README.*|TODO|HACKING)|.*/doc/.*)", 50,150,255, 50,150,255
ColorAssign5="D-I build system",".*/trunk/([^/]*|(build|installer|scripts)/.*)", 255,255,0, 255,255,0
ColorAssign6="Components: templates",".*\.templates", 0,255,255, 0,255,255
ColorAssign7="Components: translations",".*(\.pot?|POTFILES.in)", 0,140,140, 0,140,140
ColorAssign8="Components: partman",".*/partman/.*", 255,100,255, 255,100,255
ColorAssign9="Components: C code",".*(\.[ch]|\.cpp)", 255,0,0,255,0,0
ColorAssign10="Components: other",".*", 255,200,50, 255,200,50

# Save each frame to an image?
TakeSnapshots=true

# Where to save each frame
SnapshotLocation=frames/code_swarm-#####.png

# Draw names (combinatory) :
# Draw sharp names?
DrawNamesSharp=true
# And draw a glow around names? (Runs slower)
DrawNamesHalos=false

# Draw files (combinatory) :
# Draw sharp files
DrawFilesSharp=false
# Draw fuzzy files
DrawFilesFuzzy=true
# Draw jelly files
DrawFilesJelly=false

# Show the Legend at start
ShowLegend=true

# Show the History at start
ShowHistory=true

# Show the Date at start
ShowDate=true

# Show edges between authors and files, mostly for debug purpose
ShowEdges=false

# Turn on Debug counts.
ShowDebug=false

# Natural distance of files to people
EdgeLength=45

# Amount of life to decrement
EdgeDecrement=-2
FileDecrement=-2
PersonDecrement=-1

#Speeds.
#Optional: NodeSpeed=7.0, If used, FileSpeed and PersonSpeed need not be set.
#
FileSpeed=7.0
PersonSpeed=2.0

#Masses
FileMass=1.0
PersonMass=10.0

# Life of an Edge
EdgeLife=250

# Life of a File
FileLife=150

# Life of a Person
PersonLife=255

# Highlight percent.
# This is the amount of time that the person or
# file will be highlighted.
HighlightPct=8

## Physics engine selection and configuration
# Directory physics engine config files reside in.
PhysicsEngineConfigDir=physics_engine
# Force calculation algorithms ("PhysicsEngineLegacy", "PhysicsEngineSimple"...) :
PhysicsEngineSelection=PhysicsEngineLegacy

# OpenGL is experimental. Use at your own risk.
UseOpenGL=false
# New entry
/^-------------------------------------------+$/ {
	if (lines != "" && skip_entry != 1) {
		print lines
	}
	lines = ""
	skip_entry=0
}

# If called with 'year=9999', only select commits for that year
/^r[0-9]+ \|/ {
	regexp="\\| "year"-"
	if (year != "" && $0 !~ regexp) {
		skip_entry = 1
	}
}

# Skip some specific commits
# - large repository restructuring: 11648, 11697-11699
# - CVS->SVN conversion: 11568, 11612, 11641, 14559
# - l10n-sync conversions: 20877, 31874, 57349
# - untagged commits related to (failed) l10n-sync runs:
#   26590, 29874, 33396, 38877, 50991, 50995, 51875, 57682
# Maybe also to be excluded:
# - massive debconf-updatepo run: 15554
/^r(11(568|612|641|648|69[7-9])|14559|20877|31874|57349|26590|29874|33396|38877|50991|50995|51875|57682) \|/ {
	skip_entry = 1
}

# Exclude automated l10n sync runs for D-I and the manual
# Note that for D-I this means some updates we do show before the
# implementation of masters files, are no longer shown. The problem
# is mainly one of frequency and size of updates.
/(\[SILENT_COMMIT\]|\[l10n-sync\]|Run debconf-updatepo on all packages|Synchronising with translation files|Updated packages\/po\/\* (against package templates|with general template\.pot)|Update of POT and PO files for the manual)/ {
	skip_entry = 1
}

/.*/ {
	if (lines == "") {
		lines = $0
	} else {
		lines = lines "\n" $0
	}
}

END {
		print lines
}

Reply to: